
bin/kernel:     file format elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:
.text
.globl kern_entry
kern_entry:
    # reload temperate gdt (second time) to remap all physical memory
    # virtual_addr 0~4G=linear_addr&physical_addr -KERNBASE~4G-KERNBASE 
    lgdt REALLOC(__gdtdesc)
c0100000:	0f 01 15 18 90 11 00 	lgdtl  0x119018
    movl $KERNEL_DS, %eax
c0100007:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c010000c:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c010000e:	8e c0                	mov    %eax,%es
    movw %ax, %ss
c0100010:	8e d0                	mov    %eax,%ss

    ljmp $KERNEL_CS, $relocated
c0100012:	ea 19 00 10 c0 08 00 	ljmp   $0x8,$0xc0100019

c0100019 <relocated>:

relocated:

    # set ebp, esp
    movl $0x0, %ebp
c0100019:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
c010001e:	bc 00 90 11 c0       	mov    $0xc0119000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
c0100023:	e8 04 00 00 00       	call   c010002c <kern_init>

c0100028 <spin>:

# should never get here
spin:
    jmp spin
c0100028:	eb fe                	jmp    c0100028 <spin>
	...

c010002c <kern_init>:
#include <pmm.h>

int kern_init(void) __attribute__((noreturn));

int
kern_init(void) {
c010002c:	55                   	push   %ebp
c010002d:	89 e5                	mov    %esp,%ebp
c010002f:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
c0100032:	ba dc a9 11 c0       	mov    $0xc011a9dc,%edx
c0100037:	b8 98 9a 11 c0       	mov    $0xc0119a98,%eax
c010003c:	89 d1                	mov    %edx,%ecx
c010003e:	29 c1                	sub    %eax,%ecx
c0100040:	89 c8                	mov    %ecx,%eax
c0100042:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100046:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c010004d:	00 
c010004e:	c7 04 24 98 9a 11 c0 	movl   $0xc0119a98,(%esp)
c0100055:	e8 dd 5d 00 00       	call   c0105e37 <memset>

    cons_init();                // init the console
c010005a:	e8 44 1f 00 00       	call   c0101fa3 <cons_init>

    const char *message = "(THU.CST) os is loading ...";
c010005f:	c7 45 f4 c0 5f 10 c0 	movl   $0xc0105fc0,-0xc(%ebp)
    cprintf("%s\n\n", message);
c0100066:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100069:	89 44 24 04          	mov    %eax,0x4(%esp)
c010006d:	c7 04 24 dc 5f 10 c0 	movl   $0xc0105fdc,(%esp)
c0100074:	e8 33 01 00 00       	call   c01001ac <cprintf>

    print_kerninfo();
c0100079:	e8 77 06 00 00       	call   c01006f5 <print_kerninfo>

    debug_init();               // init debug registers
c010007e:	e8 7f 0c 00 00       	call   c0100d02 <debug_init>
    pmm_init();                 // init physical memory management
c0100083:	e8 b1 42 00 00       	call   c0104339 <pmm_init>

    pic_init();                 // init interrupt controller
c0100088:	e8 88 20 00 00       	call   c0102115 <pic_init>
    idt_init();                 // init interrupt descriptor table
c010008d:	e8 00 22 00 00       	call   c0102292 <idt_init>

    clock_init();               // init clock interrupt
c0100092:	e8 b9 16 00 00       	call   c0101750 <clock_init>
    intr_enable();              // enable irq interrupt
c0100097:	e8 e0 1f 00 00       	call   c010207c <intr_enable>

    /* do nothing */
    while (1);
c010009c:	eb fe                	jmp    c010009c <kern_init+0x70>
	...

c01000a0 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c01000a0:	55                   	push   %ebp
c01000a1:	89 e5                	mov    %esp,%ebp
c01000a3:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
c01000a6:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01000aa:	74 13                	je     c01000bf <readline+0x1f>
        cprintf("%s", prompt);
c01000ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01000af:	89 44 24 04          	mov    %eax,0x4(%esp)
c01000b3:	c7 04 24 e1 5f 10 c0 	movl   $0xc0105fe1,(%esp)
c01000ba:	e8 ed 00 00 00       	call   c01001ac <cprintf>
    }
    int i = 0, c;
c01000bf:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c01000c6:	eb 01                	jmp    c01000c9 <readline+0x29>
        else if (c == '\n' || c == '\r') {
            cputchar(c);
            buf[i] = '\0';
            return buf;
        }
    }
c01000c8:	90                   	nop
    if (prompt != NULL) {
        cprintf("%s", prompt);
    }
    int i = 0, c;
    while (1) {
        c = getchar();
c01000c9:	e8 69 01 00 00       	call   c0100237 <getchar>
c01000ce:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (c < 0) {
c01000d1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01000d5:	79 07                	jns    c01000de <readline+0x3e>
            return NULL;
c01000d7:	b8 00 00 00 00       	mov    $0x0,%eax
c01000dc:	eb 76                	jmp    c0100154 <readline+0xb4>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c01000de:	83 7d f4 1f          	cmpl   $0x1f,-0xc(%ebp)
c01000e2:	7e 26                	jle    c010010a <readline+0x6a>
c01000e4:	81 7d f0 fe 03 00 00 	cmpl   $0x3fe,-0x10(%ebp)
c01000eb:	7f 1d                	jg     c010010a <readline+0x6a>
            cputchar(c);
c01000ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01000f0:	89 04 24             	mov    %eax,(%esp)
c01000f3:	e8 da 00 00 00       	call   c01001d2 <cputchar>
            buf[i ++] = c;
c01000f8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01000fb:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01000fe:	88 90 a0 9a 11 c0    	mov    %dl,-0x3fee6560(%eax)
c0100104:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
    while (1) {
        c = getchar();
        if (c < 0) {
            return NULL;
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c0100108:	eb 45                	jmp    c010014f <readline+0xaf>
            cputchar(c);
            buf[i ++] = c;
        }
        else if (c == '\b' && i > 0) {
c010010a:	83 7d f4 08          	cmpl   $0x8,-0xc(%ebp)
c010010e:	75 17                	jne    c0100127 <readline+0x87>
c0100110:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100114:	7e 11                	jle    c0100127 <readline+0x87>
            cputchar(c);
c0100116:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100119:	89 04 24             	mov    %eax,(%esp)
c010011c:	e8 b1 00 00 00       	call   c01001d2 <cputchar>
            i --;
c0100121:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
            cputchar(c);
            buf[i ++] = c;
        }
        else if (c == '\b' && i > 0) {
c0100125:	eb 28                	jmp    c010014f <readline+0xaf>
            cputchar(c);
            i --;
        }
        else if (c == '\n' || c == '\r') {
c0100127:	83 7d f4 0a          	cmpl   $0xa,-0xc(%ebp)
c010012b:	74 06                	je     c0100133 <readline+0x93>
c010012d:	83 7d f4 0d          	cmpl   $0xd,-0xc(%ebp)
c0100131:	75 95                	jne    c01000c8 <readline+0x28>
            cputchar(c);
c0100133:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100136:	89 04 24             	mov    %eax,(%esp)
c0100139:	e8 94 00 00 00       	call   c01001d2 <cputchar>
            buf[i] = '\0';
c010013e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100141:	c6 80 a0 9a 11 c0 00 	movb   $0x0,-0x3fee6560(%eax)
            return buf;
c0100148:	b8 a0 9a 11 c0       	mov    $0xc0119aa0,%eax
c010014d:	eb 05                	jmp    c0100154 <readline+0xb4>
        }
    }
c010014f:	e9 75 ff ff ff       	jmp    c01000c9 <readline+0x29>
}
c0100154:	c9                   	leave  
c0100155:	c3                   	ret    
	...

c0100158 <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c0100158:	55                   	push   %ebp
c0100159:	89 e5                	mov    %esp,%ebp
c010015b:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c010015e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100161:	89 04 24             	mov    %eax,(%esp)
c0100164:	e8 66 1e 00 00       	call   c0101fcf <cons_putc>
    (*cnt) ++;
c0100169:	8b 45 0c             	mov    0xc(%ebp),%eax
c010016c:	8b 00                	mov    (%eax),%eax
c010016e:	8d 50 01             	lea    0x1(%eax),%edx
c0100171:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100174:	89 10                	mov    %edx,(%eax)
}
c0100176:	c9                   	leave  
c0100177:	c3                   	ret    

c0100178 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c0100178:	55                   	push   %ebp
c0100179:	89 e5                	mov    %esp,%ebp
c010017b:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c010017e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
c0100185:	b8 58 01 10 c0       	mov    $0xc0100158,%eax
c010018a:	8b 55 0c             	mov    0xc(%ebp),%edx
c010018d:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0100191:	8b 55 08             	mov    0x8(%ebp),%edx
c0100194:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100198:	8d 55 f4             	lea    -0xc(%ebp),%edx
c010019b:	89 54 24 04          	mov    %edx,0x4(%esp)
c010019f:	89 04 24             	mov    %eax,(%esp)
c01001a2:	e8 91 54 00 00       	call   c0105638 <vprintfmt>
    return cnt;
c01001a7:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01001aa:	c9                   	leave  
c01001ab:	c3                   	ret    

c01001ac <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c01001ac:	55                   	push   %ebp
c01001ad:	89 e5                	mov    %esp,%ebp
c01001af:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c01001b2:	8d 45 0c             	lea    0xc(%ebp),%eax
c01001b5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
c01001b8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01001bb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001bf:	8b 45 08             	mov    0x8(%ebp),%eax
c01001c2:	89 04 24             	mov    %eax,(%esp)
c01001c5:	e8 ae ff ff ff       	call   c0100178 <vcprintf>
c01001ca:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c01001cd:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01001d0:	c9                   	leave  
c01001d1:	c3                   	ret    

c01001d2 <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c01001d2:	55                   	push   %ebp
c01001d3:	89 e5                	mov    %esp,%ebp
c01001d5:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c01001d8:	8b 45 08             	mov    0x8(%ebp),%eax
c01001db:	89 04 24             	mov    %eax,(%esp)
c01001de:	e8 ec 1d 00 00       	call   c0101fcf <cons_putc>
}
c01001e3:	c9                   	leave  
c01001e4:	c3                   	ret    

c01001e5 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01001e5:	55                   	push   %ebp
c01001e6:	89 e5                	mov    %esp,%ebp
c01001e8:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c01001eb:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
c01001f2:	eb 13                	jmp    c0100207 <cputs+0x22>
        cputch(c, &cnt);
c01001f4:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c01001f8:	8d 55 f0             	lea    -0x10(%ebp),%edx
c01001fb:	89 54 24 04          	mov    %edx,0x4(%esp)
c01001ff:	89 04 24             	mov    %eax,(%esp)
c0100202:	e8 51 ff ff ff       	call   c0100158 <cputch>
 * */
int
cputs(const char *str) {
    int cnt = 0;
    char c;
    while ((c = *str ++) != '\0') {
c0100207:	8b 45 08             	mov    0x8(%ebp),%eax
c010020a:	0f b6 00             	movzbl (%eax),%eax
c010020d:	88 45 f7             	mov    %al,-0x9(%ebp)
c0100210:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c0100214:	0f 95 c0             	setne  %al
c0100217:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c010021b:	84 c0                	test   %al,%al
c010021d:	75 d5                	jne    c01001f4 <cputs+0xf>
        cputch(c, &cnt);
    }
    cputch('\n', &cnt);
c010021f:	8d 45 f0             	lea    -0x10(%ebp),%eax
c0100222:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100226:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
c010022d:	e8 26 ff ff ff       	call   c0100158 <cputch>
    return cnt;
c0100232:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0100235:	c9                   	leave  
c0100236:	c3                   	ret    

c0100237 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c0100237:	55                   	push   %ebp
c0100238:	89 e5                	mov    %esp,%ebp
c010023a:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
c010023d:	e8 c9 1d 00 00       	call   c010200b <cons_getc>
c0100242:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100245:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100249:	74 f2                	je     c010023d <getchar+0x6>
        /* do nothing */;
    return c;
c010024b:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010024e:	c9                   	leave  
c010024f:	c3                   	ret    

c0100250 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0100250:	55                   	push   %ebp
c0100251:	89 e5                	mov    %esp,%ebp
c0100253:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0100256:	9c                   	pushf  
c0100257:	58                   	pop    %eax
c0100258:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c010025b:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c010025e:	25 00 02 00 00       	and    $0x200,%eax
c0100263:	85 c0                	test   %eax,%eax
c0100265:	74 0c                	je     c0100273 <__intr_save+0x23>
        intr_disable();
c0100267:	e8 16 1e 00 00       	call   c0102082 <intr_disable>
        return 1;
c010026c:	b8 01 00 00 00       	mov    $0x1,%eax
c0100271:	eb 05                	jmp    c0100278 <__intr_save+0x28>
    }
    return 0;
c0100273:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100278:	c9                   	leave  
c0100279:	c3                   	ret    

c010027a <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c010027a:	55                   	push   %ebp
c010027b:	89 e5                	mov    %esp,%ebp
c010027d:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0100280:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100284:	74 05                	je     c010028b <__intr_restore+0x11>
        intr_enable();
c0100286:	e8 f1 1d 00 00       	call   c010207c <intr_enable>
    }
}
c010028b:	c9                   	leave  
c010028c:	c3                   	ret    

c010028d <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
c010028d:	55                   	push   %ebp
c010028e:	89 e5                	mov    %esp,%ebp
c0100290:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
c0100293:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100296:	8b 00                	mov    (%eax),%eax
c0100298:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010029b:	8b 45 10             	mov    0x10(%ebp),%eax
c010029e:	8b 00                	mov    (%eax),%eax
c01002a0:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01002a3:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
c01002aa:	e9 c8 00 00 00       	jmp    c0100377 <stab_binsearch+0xea>
        int true_m = (l + r) / 2, m = true_m;
c01002af:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002b2:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01002b5:	8d 04 02             	lea    (%edx,%eax,1),%eax
c01002b8:	89 c2                	mov    %eax,%edx
c01002ba:	c1 ea 1f             	shr    $0x1f,%edx
c01002bd:	8d 04 02             	lea    (%edx,%eax,1),%eax
c01002c0:	d1 f8                	sar    %eax
c01002c2:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01002c5:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01002c8:	89 45 fc             	mov    %eax,-0x4(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c01002cb:	eb 04                	jmp    c01002d1 <stab_binsearch+0x44>
            m --;
c01002cd:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)

    while (l <= r) {
        int true_m = (l + r) / 2, m = true_m;

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c01002d1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01002d4:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01002d7:	7c 1b                	jl     c01002f4 <stab_binsearch+0x67>
c01002d9:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01002dc:	89 d0                	mov    %edx,%eax
c01002de:	01 c0                	add    %eax,%eax
c01002e0:	01 d0                	add    %edx,%eax
c01002e2:	c1 e0 02             	shl    $0x2,%eax
c01002e5:	03 45 08             	add    0x8(%ebp),%eax
c01002e8:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01002ec:	0f b6 c0             	movzbl %al,%eax
c01002ef:	3b 45 14             	cmp    0x14(%ebp),%eax
c01002f2:	75 d9                	jne    c01002cd <stab_binsearch+0x40>
            m --;
        }
        if (m < l) {    // no match in [l, m]
c01002f4:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01002f7:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01002fa:	7d 0b                	jge    c0100307 <stab_binsearch+0x7a>
            l = true_m + 1;
c01002fc:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01002ff:	83 c0 01             	add    $0x1,%eax
c0100302:	89 45 ec             	mov    %eax,-0x14(%ebp)
            continue;
c0100305:	eb 70                	jmp    c0100377 <stab_binsearch+0xea>
        }

        // actual binary search
        any_matches = 1;
c0100307:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
c010030e:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100311:	89 d0                	mov    %edx,%eax
c0100313:	01 c0                	add    %eax,%eax
c0100315:	01 d0                	add    %edx,%eax
c0100317:	c1 e0 02             	shl    $0x2,%eax
c010031a:	03 45 08             	add    0x8(%ebp),%eax
c010031d:	8b 40 08             	mov    0x8(%eax),%eax
c0100320:	3b 45 18             	cmp    0x18(%ebp),%eax
c0100323:	73 13                	jae    c0100338 <stab_binsearch+0xab>
            *region_left = m;
c0100325:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100328:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010032b:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
c010032d:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100330:	83 c0 01             	add    $0x1,%eax
c0100333:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0100336:	eb 3f                	jmp    c0100377 <stab_binsearch+0xea>
        } else if (stabs[m].n_value > addr) {
c0100338:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010033b:	89 d0                	mov    %edx,%eax
c010033d:	01 c0                	add    %eax,%eax
c010033f:	01 d0                	add    %edx,%eax
c0100341:	c1 e0 02             	shl    $0x2,%eax
c0100344:	03 45 08             	add    0x8(%ebp),%eax
c0100347:	8b 40 08             	mov    0x8(%eax),%eax
c010034a:	3b 45 18             	cmp    0x18(%ebp),%eax
c010034d:	76 16                	jbe    c0100365 <stab_binsearch+0xd8>
            *region_right = m - 1;
c010034f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100352:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100355:	8b 45 10             	mov    0x10(%ebp),%eax
c0100358:	89 10                	mov    %edx,(%eax)
            r = m - 1;
c010035a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010035d:	83 e8 01             	sub    $0x1,%eax
c0100360:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0100363:	eb 12                	jmp    c0100377 <stab_binsearch+0xea>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
c0100365:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100368:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010036b:	89 10                	mov    %edx,(%eax)
            l = m;
c010036d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100370:	89 45 ec             	mov    %eax,-0x14(%ebp)
            addr ++;
c0100373:	83 45 18 01          	addl   $0x1,0x18(%ebp)
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
    int l = *region_left, r = *region_right, any_matches = 0;

    while (l <= r) {
c0100377:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010037a:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c010037d:	0f 8e 2c ff ff ff    	jle    c01002af <stab_binsearch+0x22>
            l = m;
            addr ++;
        }
    }

    if (!any_matches) {
c0100383:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100387:	75 0f                	jne    c0100398 <stab_binsearch+0x10b>
        *region_right = *region_left - 1;
c0100389:	8b 45 0c             	mov    0xc(%ebp),%eax
c010038c:	8b 00                	mov    (%eax),%eax
c010038e:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100391:	8b 45 10             	mov    0x10(%ebp),%eax
c0100394:	89 10                	mov    %edx,(%eax)
c0100396:	eb 3b                	jmp    c01003d3 <stab_binsearch+0x146>
    }
    else {
        // find rightmost region containing 'addr'
        l = *region_right;
c0100398:	8b 45 10             	mov    0x10(%ebp),%eax
c010039b:	8b 00                	mov    (%eax),%eax
c010039d:	89 45 ec             	mov    %eax,-0x14(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
c01003a0:	eb 04                	jmp    c01003a6 <stab_binsearch+0x119>
c01003a2:	83 6d ec 01          	subl   $0x1,-0x14(%ebp)
c01003a6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003a9:	8b 00                	mov    (%eax),%eax
c01003ab:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01003ae:	7d 1b                	jge    c01003cb <stab_binsearch+0x13e>
c01003b0:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01003b3:	89 d0                	mov    %edx,%eax
c01003b5:	01 c0                	add    %eax,%eax
c01003b7:	01 d0                	add    %edx,%eax
c01003b9:	c1 e0 02             	shl    $0x2,%eax
c01003bc:	03 45 08             	add    0x8(%ebp),%eax
c01003bf:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01003c3:	0f b6 c0             	movzbl %al,%eax
c01003c6:	3b 45 14             	cmp    0x14(%ebp),%eax
c01003c9:	75 d7                	jne    c01003a2 <stab_binsearch+0x115>
            /* do nothing */;
        *region_left = l;
c01003cb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003ce:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01003d1:	89 10                	mov    %edx,(%eax)
    }
}
c01003d3:	c9                   	leave  
c01003d4:	c3                   	ret    

c01003d5 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c01003d5:	55                   	push   %ebp
c01003d6:	89 e5                	mov    %esp,%ebp
c01003d8:	53                   	push   %ebx
c01003d9:	83 ec 54             	sub    $0x54,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
c01003dc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003df:	c7 00 e4 5f 10 c0    	movl   $0xc0105fe4,(%eax)
    info->eip_line = 0;
c01003e5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003e8:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
c01003ef:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003f2:	c7 40 08 e4 5f 10 c0 	movl   $0xc0105fe4,0x8(%eax)
    info->eip_fn_namelen = 9;
c01003f9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01003fc:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
c0100403:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100406:	8b 55 08             	mov    0x8(%ebp),%edx
c0100409:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
c010040c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010040f:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
c0100416:	c7 45 e8 dc 76 10 c0 	movl   $0xc01076dc,-0x18(%ebp)
    stab_end = __STAB_END__;
c010041d:	c7 45 ec 38 38 11 c0 	movl   $0xc0113838,-0x14(%ebp)
    stabstr = __STABSTR_BEGIN__;
c0100424:	c7 45 f0 39 38 11 c0 	movl   $0xc0113839,-0x10(%ebp)
    stabstr_end = __STABSTR_END__;
c010042b:	c7 45 f4 0e 65 11 c0 	movl   $0xc011650e,-0xc(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c0100432:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100435:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0100438:	76 0d                	jbe    c0100447 <debuginfo_eip+0x72>
c010043a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010043d:	83 e8 01             	sub    $0x1,%eax
c0100440:	0f b6 00             	movzbl (%eax),%eax
c0100443:	84 c0                	test   %al,%al
c0100445:	74 0a                	je     c0100451 <debuginfo_eip+0x7c>
        return -1;
c0100447:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c010044c:	e9 9e 02 00 00       	jmp    c01006ef <debuginfo_eip+0x31a>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
c0100451:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c0100458:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010045b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010045e:	89 d1                	mov    %edx,%ecx
c0100460:	29 c1                	sub    %eax,%ecx
c0100462:	89 c8                	mov    %ecx,%eax
c0100464:	c1 f8 02             	sar    $0x2,%eax
c0100467:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c010046d:	83 e8 01             	sub    $0x1,%eax
c0100470:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c0100473:	8b 45 08             	mov    0x8(%ebp),%eax
c0100476:	89 44 24 10          	mov    %eax,0x10(%esp)
c010047a:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
c0100481:	00 
c0100482:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0100485:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100489:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c010048c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100490:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100493:	89 04 24             	mov    %eax,(%esp)
c0100496:	e8 f2 fd ff ff       	call   c010028d <stab_binsearch>
    if (lfile == 0)
c010049b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010049e:	85 c0                	test   %eax,%eax
c01004a0:	75 0a                	jne    c01004ac <debuginfo_eip+0xd7>
        return -1;
c01004a2:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01004a7:	e9 43 02 00 00       	jmp    c01006ef <debuginfo_eip+0x31a>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
c01004ac:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01004af:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01004b2:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01004b5:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c01004b8:	8b 45 08             	mov    0x8(%ebp),%eax
c01004bb:	89 44 24 10          	mov    %eax,0x10(%esp)
c01004bf:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
c01004c6:	00 
c01004c7:	8d 45 d8             	lea    -0x28(%ebp),%eax
c01004ca:	89 44 24 08          	mov    %eax,0x8(%esp)
c01004ce:	8d 45 dc             	lea    -0x24(%ebp),%eax
c01004d1:	89 44 24 04          	mov    %eax,0x4(%esp)
c01004d5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01004d8:	89 04 24             	mov    %eax,(%esp)
c01004db:	e8 ad fd ff ff       	call   c010028d <stab_binsearch>

    if (lfun <= rfun) {
c01004e0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01004e3:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01004e6:	39 c2                	cmp    %eax,%edx
c01004e8:	7f 72                	jg     c010055c <debuginfo_eip+0x187>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c01004ea:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01004ed:	89 c2                	mov    %eax,%edx
c01004ef:	89 d0                	mov    %edx,%eax
c01004f1:	01 c0                	add    %eax,%eax
c01004f3:	01 d0                	add    %edx,%eax
c01004f5:	c1 e0 02             	shl    $0x2,%eax
c01004f8:	03 45 e8             	add    -0x18(%ebp),%eax
c01004fb:	8b 10                	mov    (%eax),%edx
c01004fd:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100500:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100503:	89 cb                	mov    %ecx,%ebx
c0100505:	29 c3                	sub    %eax,%ebx
c0100507:	89 d8                	mov    %ebx,%eax
c0100509:	39 c2                	cmp    %eax,%edx
c010050b:	73 1e                	jae    c010052b <debuginfo_eip+0x156>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c010050d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100510:	89 c2                	mov    %eax,%edx
c0100512:	89 d0                	mov    %edx,%eax
c0100514:	01 c0                	add    %eax,%eax
c0100516:	01 d0                	add    %edx,%eax
c0100518:	c1 e0 02             	shl    $0x2,%eax
c010051b:	03 45 e8             	add    -0x18(%ebp),%eax
c010051e:	8b 00                	mov    (%eax),%eax
c0100520:	89 c2                	mov    %eax,%edx
c0100522:	03 55 f0             	add    -0x10(%ebp),%edx
c0100525:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100528:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
c010052b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010052e:	89 c2                	mov    %eax,%edx
c0100530:	89 d0                	mov    %edx,%eax
c0100532:	01 c0                	add    %eax,%eax
c0100534:	01 d0                	add    %edx,%eax
c0100536:	c1 e0 02             	shl    $0x2,%eax
c0100539:	03 45 e8             	add    -0x18(%ebp),%eax
c010053c:	8b 50 08             	mov    0x8(%eax),%edx
c010053f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100542:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
c0100545:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100548:	8b 40 10             	mov    0x10(%eax),%eax
c010054b:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
c010054e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100551:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
c0100554:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100557:	89 45 d0             	mov    %eax,-0x30(%ebp)
c010055a:	eb 15                	jmp    c0100571 <debuginfo_eip+0x19c>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
c010055c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010055f:	8b 55 08             	mov    0x8(%ebp),%edx
c0100562:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
c0100565:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100568:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
c010056b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010056e:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c0100571:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100574:	8b 40 08             	mov    0x8(%eax),%eax
c0100577:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
c010057e:	00 
c010057f:	89 04 24             	mov    %eax,(%esp)
c0100582:	e8 28 57 00 00       	call   c0105caf <strfind>
c0100587:	89 c2                	mov    %eax,%edx
c0100589:	8b 45 0c             	mov    0xc(%ebp),%eax
c010058c:	8b 40 08             	mov    0x8(%eax),%eax
c010058f:	29 c2                	sub    %eax,%edx
c0100591:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100594:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c0100597:	8b 45 08             	mov    0x8(%ebp),%eax
c010059a:	89 44 24 10          	mov    %eax,0x10(%esp)
c010059e:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
c01005a5:	00 
c01005a6:	8d 45 d0             	lea    -0x30(%ebp),%eax
c01005a9:	89 44 24 08          	mov    %eax,0x8(%esp)
c01005ad:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c01005b0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01005b4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01005b7:	89 04 24             	mov    %eax,(%esp)
c01005ba:	e8 ce fc ff ff       	call   c010028d <stab_binsearch>
    if (lline <= rline) {
c01005bf:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01005c2:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01005c5:	39 c2                	cmp    %eax,%edx
c01005c7:	7f 20                	jg     c01005e9 <debuginfo_eip+0x214>
        info->eip_line = stabs[rline].n_desc;
c01005c9:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01005cc:	89 c2                	mov    %eax,%edx
c01005ce:	89 d0                	mov    %edx,%eax
c01005d0:	01 c0                	add    %eax,%eax
c01005d2:	01 d0                	add    %edx,%eax
c01005d4:	c1 e0 02             	shl    $0x2,%eax
c01005d7:	03 45 e8             	add    -0x18(%ebp),%eax
c01005da:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c01005de:	0f b7 d0             	movzwl %ax,%edx
c01005e1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005e4:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c01005e7:	eb 13                	jmp    c01005fc <debuginfo_eip+0x227>
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
    if (lline <= rline) {
        info->eip_line = stabs[rline].n_desc;
    } else {
        return -1;
c01005e9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01005ee:	e9 fc 00 00 00       	jmp    c01006ef <debuginfo_eip+0x31a>
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
c01005f3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01005f6:	83 e8 01             	sub    $0x1,%eax
c01005f9:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
           && stabs[lline].n_type != N_SOL
c01005fc:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01005ff:	8b 45 e4             	mov    -0x1c(%ebp),%eax

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c0100602:	39 c2                	cmp    %eax,%edx
c0100604:	7c 4a                	jl     c0100650 <debuginfo_eip+0x27b>
           && stabs[lline].n_type != N_SOL
c0100606:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100609:	89 c2                	mov    %eax,%edx
c010060b:	89 d0                	mov    %edx,%eax
c010060d:	01 c0                	add    %eax,%eax
c010060f:	01 d0                	add    %edx,%eax
c0100611:	c1 e0 02             	shl    $0x2,%eax
c0100614:	03 45 e8             	add    -0x18(%ebp),%eax
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c0100617:	0f b6 40 04          	movzbl 0x4(%eax),%eax

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c010061b:	3c 84                	cmp    $0x84,%al
c010061d:	74 31                	je     c0100650 <debuginfo_eip+0x27b>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c010061f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100622:	89 c2                	mov    %eax,%edx
c0100624:	89 d0                	mov    %edx,%eax
c0100626:	01 c0                	add    %eax,%eax
c0100628:	01 d0                	add    %edx,%eax
c010062a:	c1 e0 02             	shl    $0x2,%eax
c010062d:	03 45 e8             	add    -0x18(%ebp),%eax
c0100630:	0f b6 40 04          	movzbl 0x4(%eax),%eax

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c0100634:	3c 64                	cmp    $0x64,%al
c0100636:	75 bb                	jne    c01005f3 <debuginfo_eip+0x21e>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c0100638:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010063b:	89 c2                	mov    %eax,%edx
c010063d:	89 d0                	mov    %edx,%eax
c010063f:	01 c0                	add    %eax,%eax
c0100641:	01 d0                	add    %edx,%eax
c0100643:	c1 e0 02             	shl    $0x2,%eax
c0100646:	03 45 e8             	add    -0x18(%ebp),%eax
c0100649:	8b 40 08             	mov    0x8(%eax),%eax

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c010064c:	85 c0                	test   %eax,%eax
c010064e:	74 a3                	je     c01005f3 <debuginfo_eip+0x21e>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c0100650:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100653:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100656:	39 c2                	cmp    %eax,%edx
c0100658:	7c 40                	jl     c010069a <debuginfo_eip+0x2c5>
c010065a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010065d:	89 c2                	mov    %eax,%edx
c010065f:	89 d0                	mov    %edx,%eax
c0100661:	01 c0                	add    %eax,%eax
c0100663:	01 d0                	add    %edx,%eax
c0100665:	c1 e0 02             	shl    $0x2,%eax
c0100668:	03 45 e8             	add    -0x18(%ebp),%eax
c010066b:	8b 10                	mov    (%eax),%edx
c010066d:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100670:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100673:	89 cb                	mov    %ecx,%ebx
c0100675:	29 c3                	sub    %eax,%ebx
c0100677:	89 d8                	mov    %ebx,%eax
c0100679:	39 c2                	cmp    %eax,%edx
c010067b:	73 1d                	jae    c010069a <debuginfo_eip+0x2c5>
        info->eip_file = stabstr + stabs[lline].n_strx;
c010067d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100680:	89 c2                	mov    %eax,%edx
c0100682:	89 d0                	mov    %edx,%eax
c0100684:	01 c0                	add    %eax,%eax
c0100686:	01 d0                	add    %edx,%eax
c0100688:	c1 e0 02             	shl    $0x2,%eax
c010068b:	03 45 e8             	add    -0x18(%ebp),%eax
c010068e:	8b 00                	mov    (%eax),%eax
c0100690:	89 c2                	mov    %eax,%edx
c0100692:	03 55 f0             	add    -0x10(%ebp),%edx
c0100695:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100698:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
c010069a:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010069d:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01006a0:	39 c2                	cmp    %eax,%edx
c01006a2:	7d 46                	jge    c01006ea <debuginfo_eip+0x315>
        for (lline = lfun + 1;
c01006a4:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006a7:	83 c0 01             	add    $0x1,%eax
c01006aa:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c01006ad:	eb 18                	jmp    c01006c7 <debuginfo_eip+0x2f2>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
c01006af:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006b2:	8b 40 14             	mov    0x14(%eax),%eax
c01006b5:	8d 50 01             	lea    0x1(%eax),%edx
c01006b8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006bb:	89 50 14             	mov    %edx,0x14(%eax)
    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
c01006be:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01006c1:	83 c0 01             	add    $0x1,%eax
c01006c4:	89 45 d4             	mov    %eax,-0x2c(%ebp)

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
             lline < rfun && stabs[lline].n_type == N_PSYM;
c01006c7:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01006ca:	8b 45 d8             	mov    -0x28(%ebp),%eax
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
c01006cd:	39 c2                	cmp    %eax,%edx
c01006cf:	7d 19                	jge    c01006ea <debuginfo_eip+0x315>
             lline < rfun && stabs[lline].n_type == N_PSYM;
c01006d1:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01006d4:	89 c2                	mov    %eax,%edx
c01006d6:	89 d0                	mov    %edx,%eax
c01006d8:	01 c0                	add    %eax,%eax
c01006da:	01 d0                	add    %edx,%eax
c01006dc:	c1 e0 02             	shl    $0x2,%eax
c01006df:	03 45 e8             	add    -0x18(%ebp),%eax
c01006e2:	0f b6 40 04          	movzbl 0x4(%eax),%eax
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
        for (lline = lfun + 1;
c01006e6:	3c a0                	cmp    $0xa0,%al
c01006e8:	74 c5                	je     c01006af <debuginfo_eip+0x2da>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
        }
    }
    return 0;
c01006ea:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01006ef:	83 c4 54             	add    $0x54,%esp
c01006f2:	5b                   	pop    %ebx
c01006f3:	5d                   	pop    %ebp
c01006f4:	c3                   	ret    

c01006f5 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c01006f5:	55                   	push   %ebp
c01006f6:	89 e5                	mov    %esp,%ebp
c01006f8:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
c01006fb:	c7 04 24 ee 5f 10 c0 	movl   $0xc0105fee,(%esp)
c0100702:	e8 a5 fa ff ff       	call   c01001ac <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
c0100707:	c7 44 24 04 2c 00 10 	movl   $0xc010002c,0x4(%esp)
c010070e:	c0 
c010070f:	c7 04 24 07 60 10 c0 	movl   $0xc0106007,(%esp)
c0100716:	e8 91 fa ff ff       	call   c01001ac <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
c010071b:	c7 44 24 04 bb 5f 10 	movl   $0xc0105fbb,0x4(%esp)
c0100722:	c0 
c0100723:	c7 04 24 1f 60 10 c0 	movl   $0xc010601f,(%esp)
c010072a:	e8 7d fa ff ff       	call   c01001ac <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
c010072f:	c7 44 24 04 98 9a 11 	movl   $0xc0119a98,0x4(%esp)
c0100736:	c0 
c0100737:	c7 04 24 37 60 10 c0 	movl   $0xc0106037,(%esp)
c010073e:	e8 69 fa ff ff       	call   c01001ac <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
c0100743:	c7 44 24 04 dc a9 11 	movl   $0xc011a9dc,0x4(%esp)
c010074a:	c0 
c010074b:	c7 04 24 4f 60 10 c0 	movl   $0xc010604f,(%esp)
c0100752:	e8 55 fa ff ff       	call   c01001ac <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c0100757:	b8 dc a9 11 c0       	mov    $0xc011a9dc,%eax
c010075c:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c0100762:	b8 2c 00 10 c0       	mov    $0xc010002c,%eax
c0100767:	89 d1                	mov    %edx,%ecx
c0100769:	29 c1                	sub    %eax,%ecx
c010076b:	89 c8                	mov    %ecx,%eax
c010076d:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c0100773:	85 c0                	test   %eax,%eax
c0100775:	0f 48 c2             	cmovs  %edx,%eax
c0100778:	c1 f8 0a             	sar    $0xa,%eax
c010077b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010077f:	c7 04 24 68 60 10 c0 	movl   $0xc0106068,(%esp)
c0100786:	e8 21 fa ff ff       	call   c01001ac <cprintf>
}
c010078b:	c9                   	leave  
c010078c:	c3                   	ret    

c010078d <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c010078d:	55                   	push   %ebp
c010078e:	89 e5                	mov    %esp,%ebp
c0100790:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
c0100796:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100799:	89 44 24 04          	mov    %eax,0x4(%esp)
c010079d:	8b 45 08             	mov    0x8(%ebp),%eax
c01007a0:	89 04 24             	mov    %eax,(%esp)
c01007a3:	e8 2d fc ff ff       	call   c01003d5 <debuginfo_eip>
c01007a8:	85 c0                	test   %eax,%eax
c01007aa:	74 15                	je     c01007c1 <print_debuginfo+0x34>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
c01007ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01007af:	89 44 24 04          	mov    %eax,0x4(%esp)
c01007b3:	c7 04 24 92 60 10 c0 	movl   $0xc0106092,(%esp)
c01007ba:	e8 ed f9 ff ff       	call   c01001ac <cprintf>
c01007bf:	eb 68                	jmp    c0100829 <print_debuginfo+0x9c>
    }
    else {
        char fnname[256];
        int j;
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c01007c1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01007c8:	eb 1a                	jmp    c01007e4 <print_debuginfo+0x57>
            fnname[j] = info.eip_fn_name[j];
c01007ca:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007cd:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
c01007d0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01007d3:	8d 14 11             	lea    (%ecx,%edx,1),%edx
c01007d6:	0f b6 12             	movzbl (%edx),%edx
c01007d9:	88 94 05 dc fe ff ff 	mov    %dl,-0x124(%ebp,%eax,1)
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
    }
    else {
        char fnname[256];
        int j;
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c01007e0:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c01007e4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01007e7:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01007ea:	7f de                	jg     c01007ca <print_debuginfo+0x3d>
            fnname[j] = info.eip_fn_name[j];
        }
        fnname[j] = '\0';
c01007ec:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007ef:	c6 84 05 dc fe ff ff 	movb   $0x0,-0x124(%ebp,%eax,1)
c01007f6:	00 
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c01007f7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01007fa:	8b 55 08             	mov    0x8(%ebp),%edx
c01007fd:	89 d1                	mov    %edx,%ecx
c01007ff:	29 c1                	sub    %eax,%ecx
c0100801:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100804:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100807:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010080b:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100811:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c0100815:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100819:	89 44 24 04          	mov    %eax,0x4(%esp)
c010081d:	c7 04 24 ae 60 10 c0 	movl   $0xc01060ae,(%esp)
c0100824:	e8 83 f9 ff ff       	call   c01001ac <cprintf>
                fnname, eip - info.eip_fn_addr);
    }
}
c0100829:	c9                   	leave  
c010082a:	c3                   	ret    

c010082b <read_eip>:

static uint32_t read_eip(void) __attribute__((noinline));

static uint32_t
read_eip(void) {
c010082b:	55                   	push   %ebp
c010082c:	89 e5                	mov    %esp,%ebp
c010082e:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c0100831:	8b 45 04             	mov    0x4(%ebp),%eax
c0100834:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
c0100837:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c010083a:	c9                   	leave  
c010083b:	c3                   	ret    

c010083c <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c010083c:	55                   	push   %ebp
c010083d:	89 e5                	mov    %esp,%ebp
c010083f:	83 ec 38             	sub    $0x38,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
c0100842:	89 e8                	mov    %ebp,%eax
c0100844:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return ebp;
c0100847:	8b 45 f4             	mov    -0xc(%ebp),%eax
    uint32_t ebp = read_ebp(), eip = read_eip();
c010084a:	89 45 e0             	mov    %eax,-0x20(%ebp)
c010084d:	e8 d9 ff ff ff       	call   c010082b <read_eip>
c0100852:	89 45 e4             	mov    %eax,-0x1c(%ebp)

    int i, j;
    for (i = 0; ebp != 0 && i < STACKFRAME_DEPTH; i ++) {
c0100855:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c010085c:	e9 82 00 00 00       	jmp    c01008e3 <print_stackframe+0xa7>
        cprintf("ebp:0x%08x eip:0x%08x args:", ebp, eip);
c0100861:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100864:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100868:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010086b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010086f:	c7 04 24 c0 60 10 c0 	movl   $0xc01060c0,(%esp)
c0100876:	e8 31 f9 ff ff       	call   c01001ac <cprintf>
        uint32_t *args = (uint32_t *)ebp + 2;
c010087b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010087e:	83 c0 08             	add    $0x8,%eax
c0100881:	89 45 f0             	mov    %eax,-0x10(%ebp)
        for (j = 0; j < 4; j ++) {
c0100884:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c010088b:	eb 1f                	jmp    c01008ac <print_stackframe+0x70>
            cprintf("0x%08x ", args[j]);
c010088d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100890:	c1 e0 02             	shl    $0x2,%eax
c0100893:	03 45 f0             	add    -0x10(%ebp),%eax
c0100896:	8b 00                	mov    (%eax),%eax
c0100898:	89 44 24 04          	mov    %eax,0x4(%esp)
c010089c:	c7 04 24 dc 60 10 c0 	movl   $0xc01060dc,(%esp)
c01008a3:	e8 04 f9 ff ff       	call   c01001ac <cprintf>

    int i, j;
    for (i = 0; ebp != 0 && i < STACKFRAME_DEPTH; i ++) {
        cprintf("ebp:0x%08x eip:0x%08x args:", ebp, eip);
        uint32_t *args = (uint32_t *)ebp + 2;
        for (j = 0; j < 4; j ++) {
c01008a8:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c01008ac:	83 7d ec 03          	cmpl   $0x3,-0x14(%ebp)
c01008b0:	7e db                	jle    c010088d <print_stackframe+0x51>
            cprintf("0x%08x ", args[j]);
        }
        cprintf("\n");
c01008b2:	c7 04 24 e4 60 10 c0 	movl   $0xc01060e4,(%esp)
c01008b9:	e8 ee f8 ff ff       	call   c01001ac <cprintf>
        print_debuginfo(eip - 1);
c01008be:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01008c1:	83 e8 01             	sub    $0x1,%eax
c01008c4:	89 04 24             	mov    %eax,(%esp)
c01008c7:	e8 c1 fe ff ff       	call   c010078d <print_debuginfo>
        eip = ((uint32_t *)ebp)[1];
c01008cc:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01008cf:	83 c0 04             	add    $0x4,%eax
c01008d2:	8b 00                	mov    (%eax),%eax
c01008d4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        ebp = ((uint32_t *)ebp)[0];
c01008d7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01008da:	8b 00                	mov    (%eax),%eax
c01008dc:	89 45 e0             	mov    %eax,-0x20(%ebp)
void
print_stackframe(void) {
    uint32_t ebp = read_ebp(), eip = read_eip();

    int i, j;
    for (i = 0; ebp != 0 && i < STACKFRAME_DEPTH; i ++) {
c01008df:	83 45 e8 01          	addl   $0x1,-0x18(%ebp)
c01008e3:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c01008e7:	74 0a                	je     c01008f3 <print_stackframe+0xb7>
c01008e9:	83 7d e8 13          	cmpl   $0x13,-0x18(%ebp)
c01008ed:	0f 8e 6e ff ff ff    	jle    c0100861 <print_stackframe+0x25>
        cprintf("\n");
        print_debuginfo(eip - 1);
        eip = ((uint32_t *)ebp)[1];
        ebp = ((uint32_t *)ebp)[0];
    }
}
c01008f3:	c9                   	leave  
c01008f4:	c3                   	ret    

c01008f5 <save_all_dr>:

static unsigned int local_dr_counter[MAX_DR_NUM];

/* save_all_dr - save all debug registers to memory and then disable them */
static void
save_all_dr(void) {
c01008f5:	55                   	push   %ebp
c01008f6:	89 e5                	mov    %esp,%ebp
c01008f8:	53                   	push   %ebx
c01008f9:	83 ec 30             	sub    $0x30,%esp
    int i;
    for (i = 0; i < MAX_DR_NUM; i ++) {
c01008fc:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
c0100903:	eb 60                	jmp    c0100965 <save_all_dr+0x70>
        local_dr[i] = read_dr(i);
c0100905:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100908:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010090b:	89 55 dc             	mov    %edx,-0x24(%ebp)
    asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
    uint32_t value = 0;
c010090e:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
    switch (regnum) {
c0100915:	83 7d dc 07          	cmpl   $0x7,-0x24(%ebp)
c0100919:	77 3c                	ja     c0100957 <save_all_dr+0x62>
c010091b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010091e:	c1 e2 02             	shl    $0x2,%edx
c0100921:	8b 92 e8 60 10 c0    	mov    -0x3fef9f18(%edx),%edx
c0100927:	ff e2                	jmp    *%edx
    case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c0100929:	0f 21 c2             	mov    %db0,%edx
c010092c:	89 55 e0             	mov    %edx,-0x20(%ebp)
c010092f:	eb 26                	jmp    c0100957 <save_all_dr+0x62>
    case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c0100931:	0f 21 ca             	mov    %db1,%edx
c0100934:	89 55 e0             	mov    %edx,-0x20(%ebp)
c0100937:	eb 1e                	jmp    c0100957 <save_all_dr+0x62>
    case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c0100939:	0f 21 d2             	mov    %db2,%edx
c010093c:	89 55 e0             	mov    %edx,-0x20(%ebp)
c010093f:	eb 16                	jmp    c0100957 <save_all_dr+0x62>
    case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c0100941:	0f 21 da             	mov    %db3,%edx
c0100944:	89 55 e0             	mov    %edx,-0x20(%ebp)
c0100947:	eb 0e                	jmp    c0100957 <save_all_dr+0x62>
    case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c0100949:	0f 21 f2             	mov    %db6,%edx
c010094c:	89 55 e0             	mov    %edx,-0x20(%ebp)
c010094f:	eb 06                	jmp    c0100957 <save_all_dr+0x62>
    case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c0100951:	0f 21 fa             	mov    %db7,%edx
c0100954:	89 55 e0             	mov    %edx,-0x20(%ebp)
    }
    return value;
c0100957:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010095a:	89 14 85 a0 9e 11 c0 	mov    %edx,-0x3fee6160(,%eax,4)

/* save_all_dr - save all debug registers to memory and then disable them */
static void
save_all_dr(void) {
    int i;
    for (i = 0; i < MAX_DR_NUM; i ++) {
c0100961:	83 45 d4 01          	addl   $0x1,-0x2c(%ebp)
c0100965:	83 7d d4 03          	cmpl   $0x3,-0x2c(%ebp)
c0100969:	7e 9a                	jle    c0100905 <save_all_dr+0x10>
c010096b:	c7 45 e4 06 00 00 00 	movl   $0x6,-0x1c(%ebp)
    asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
    uint32_t value = 0;
c0100972:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
    switch (regnum) {
c0100979:	83 7d e4 07          	cmpl   $0x7,-0x1c(%ebp)
c010097d:	77 3c                	ja     c01009bb <save_all_dr+0xc6>
c010097f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100982:	c1 e0 02             	shl    $0x2,%eax
c0100985:	8b 80 08 61 10 c0    	mov    -0x3fef9ef8(%eax),%eax
c010098b:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c010098d:	0f 21 c0             	mov    %db0,%eax
c0100990:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0100993:	eb 26                	jmp    c01009bb <save_all_dr+0xc6>
    case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c0100995:	0f 21 c8             	mov    %db1,%eax
c0100998:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010099b:	eb 1e                	jmp    c01009bb <save_all_dr+0xc6>
    case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c010099d:	0f 21 d0             	mov    %db2,%eax
c01009a0:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01009a3:	eb 16                	jmp    c01009bb <save_all_dr+0xc6>
    case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c01009a5:	0f 21 d8             	mov    %db3,%eax
c01009a8:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01009ab:	eb 0e                	jmp    c01009bb <save_all_dr+0xc6>
    case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c01009ad:	0f 21 f0             	mov    %db6,%eax
c01009b0:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01009b3:	eb 06                	jmp    c01009bb <save_all_dr+0xc6>
    case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c01009b5:	0f 21 f8             	mov    %db7,%eax
c01009b8:	89 45 e8             	mov    %eax,-0x18(%ebp)
    }
    return value;
c01009bb:	8b 45 e8             	mov    -0x18(%ebp),%eax
        local_dr[i] = read_dr(i);
    }
    status_dr = read_dr(DR_STATUS);
c01009be:	a3 b0 9e 11 c0       	mov    %eax,0xc0119eb0
c01009c3:	c7 45 ec 07 00 00 00 	movl   $0x7,-0x14(%ebp)
    asm volatile ("int $3");
}

static inline uint32_t
read_dr(unsigned regnum) {
    uint32_t value = 0;
c01009ca:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    switch (regnum) {
c01009d1:	83 7d ec 07          	cmpl   $0x7,-0x14(%ebp)
c01009d5:	77 3c                	ja     c0100a13 <save_all_dr+0x11e>
c01009d7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01009da:	c1 e0 02             	shl    $0x2,%eax
c01009dd:	8b 80 28 61 10 c0    	mov    -0x3fef9ed8(%eax),%eax
c01009e3:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %%db0, %0" : "=r" (value)); break;
c01009e5:	0f 21 c0             	mov    %db0,%eax
c01009e8:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01009eb:	eb 26                	jmp    c0100a13 <save_all_dr+0x11e>
    case 1: asm volatile ("movl %%db1, %0" : "=r" (value)); break;
c01009ed:	0f 21 c8             	mov    %db1,%eax
c01009f0:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01009f3:	eb 1e                	jmp    c0100a13 <save_all_dr+0x11e>
    case 2: asm volatile ("movl %%db2, %0" : "=r" (value)); break;
c01009f5:	0f 21 d0             	mov    %db2,%eax
c01009f8:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01009fb:	eb 16                	jmp    c0100a13 <save_all_dr+0x11e>
    case 3: asm volatile ("movl %%db3, %0" : "=r" (value)); break;
c01009fd:	0f 21 d8             	mov    %db3,%eax
c0100a00:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0100a03:	eb 0e                	jmp    c0100a13 <save_all_dr+0x11e>
    case 6: asm volatile ("movl %%db6, %0" : "=r" (value)); break;
c0100a05:	0f 21 f0             	mov    %db6,%eax
c0100a08:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0100a0b:	eb 06                	jmp    c0100a13 <save_all_dr+0x11e>
    case 7: asm volatile ("movl %%db7, %0" : "=r" (value)); break;
c0100a0d:	0f 21 f8             	mov    %db7,%eax
c0100a10:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    return value;
c0100a13:	8b 45 f0             	mov    -0x10(%ebp),%eax
    control_dr = read_dr(DR_CONTROL);
c0100a16:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
c0100a1b:	c7 45 f8 07 00 00 00 	movl   $0x7,-0x8(%ebp)
c0100a22:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
}

static void
write_dr(unsigned regnum, uint32_t value) {
    switch (regnum) {
c0100a29:	83 7d f8 07          	cmpl   $0x7,-0x8(%ebp)
c0100a2d:	77 3c                	ja     c0100a6b <save_all_dr+0x176>
c0100a2f:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100a32:	c1 e0 02             	shl    $0x2,%eax
c0100a35:	8b 80 48 61 10 c0    	mov    -0x3fef9eb8(%eax),%eax
c0100a3b:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100a3d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a40:	0f 23 c0             	mov    %eax,%db0
c0100a43:	eb 26                	jmp    c0100a6b <save_all_dr+0x176>
    case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100a45:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a48:	0f 23 c8             	mov    %eax,%db1
c0100a4b:	eb 1e                	jmp    c0100a6b <save_all_dr+0x176>
    case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100a4d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a50:	0f 23 d0             	mov    %eax,%db2
c0100a53:	eb 16                	jmp    c0100a6b <save_all_dr+0x176>
    case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100a55:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a58:	0f 23 d8             	mov    %eax,%db3
c0100a5b:	eb 0e                	jmp    c0100a6b <save_all_dr+0x176>
    case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100a5d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a60:	0f 23 f0             	mov    %eax,%db6
c0100a63:	eb 06                	jmp    c0100a6b <save_all_dr+0x176>
    case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100a65:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a68:	0f 23 f8             	mov    %eax,%db7
    // disable breakpoints while debugger is running
    write_dr(DR_CONTROL, 0);

    // increase Debug Register Counter
    unsigned regnum;
    for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100a6b:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
c0100a72:	eb 35                	jmp    c0100aa9 <save_all_dr+0x1b4>
        if (status_dr & (1 << regnum)) {
c0100a74:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100a77:	ba 01 00 00 00       	mov    $0x1,%edx
c0100a7c:	89 d3                	mov    %edx,%ebx
c0100a7e:	89 c1                	mov    %eax,%ecx
c0100a80:	d3 e3                	shl    %cl,%ebx
c0100a82:	89 d8                	mov    %ebx,%eax
c0100a84:	89 c2                	mov    %eax,%edx
c0100a86:	a1 b0 9e 11 c0       	mov    0xc0119eb0,%eax
c0100a8b:	21 d0                	and    %edx,%eax
c0100a8d:	85 c0                	test   %eax,%eax
c0100a8f:	74 14                	je     c0100aa5 <save_all_dr+0x1b0>
            local_dr_counter[regnum] ++;
c0100a91:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100a94:	8b 14 85 b8 9e 11 c0 	mov    -0x3fee6148(,%eax,4),%edx
c0100a9b:	83 c2 01             	add    $0x1,%edx
c0100a9e:	89 14 85 b8 9e 11 c0 	mov    %edx,-0x3fee6148(,%eax,4)
    // disable breakpoints while debugger is running
    write_dr(DR_CONTROL, 0);

    // increase Debug Register Counter
    unsigned regnum;
    for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100aa5:	83 45 d8 01          	addl   $0x1,-0x28(%ebp)
c0100aa9:	83 7d d8 03          	cmpl   $0x3,-0x28(%ebp)
c0100aad:	76 c5                	jbe    c0100a74 <save_all_dr+0x17f>
        if (status_dr & (1 << regnum)) {
            local_dr_counter[regnum] ++;
        }
    }
}
c0100aaf:	83 c4 30             	add    $0x30,%esp
c0100ab2:	5b                   	pop    %ebx
c0100ab3:	5d                   	pop    %ebp
c0100ab4:	c3                   	ret    

c0100ab5 <restore_all_dr>:

/* restore_all_dr - reset all debug registers and clear the status register DR6 */
static void
restore_all_dr(void) {
c0100ab5:	55                   	push   %ebp
c0100ab6:	89 e5                	mov    %esp,%ebp
c0100ab8:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; i < MAX_DR_NUM; i ++) {
c0100abb:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c0100ac2:	eb 59                	jmp    c0100b1d <restore_all_dr+0x68>
        write_dr(i, local_dr[i]);
c0100ac4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100ac7:	8b 04 85 a0 9e 11 c0 	mov    -0x3fee6160(,%eax,4),%eax
c0100ace:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0100ad1:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0100ad4:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
    switch (regnum) {
c0100ad7:	83 7d ec 07          	cmpl   $0x7,-0x14(%ebp)
c0100adb:	77 3c                	ja     c0100b19 <restore_all_dr+0x64>
c0100add:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100ae0:	c1 e0 02             	shl    $0x2,%eax
c0100ae3:	8b 80 68 61 10 c0    	mov    -0x3fef9e98(%eax),%eax
c0100ae9:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100aeb:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100aee:	0f 23 c0             	mov    %eax,%db0
c0100af1:	eb 26                	jmp    c0100b19 <restore_all_dr+0x64>
    case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100af3:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100af6:	0f 23 c8             	mov    %eax,%db1
c0100af9:	eb 1e                	jmp    c0100b19 <restore_all_dr+0x64>
    case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100afb:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100afe:	0f 23 d0             	mov    %eax,%db2
c0100b01:	eb 16                	jmp    c0100b19 <restore_all_dr+0x64>
    case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100b03:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100b06:	0f 23 d8             	mov    %eax,%db3
c0100b09:	eb 0e                	jmp    c0100b19 <restore_all_dr+0x64>
    case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100b0b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100b0e:	0f 23 f0             	mov    %eax,%db6
c0100b11:	eb 06                	jmp    c0100b19 <restore_all_dr+0x64>
    case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100b13:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100b16:	0f 23 f8             	mov    %eax,%db7

/* restore_all_dr - reset all debug registers and clear the status register DR6 */
static void
restore_all_dr(void) {
    int i;
    for (i = 0; i < MAX_DR_NUM; i ++) {
c0100b19:	83 45 e4 01          	addl   $0x1,-0x1c(%ebp)
c0100b1d:	83 7d e4 03          	cmpl   $0x3,-0x1c(%ebp)
c0100b21:	7e a1                	jle    c0100ac4 <restore_all_dr+0xf>
c0100b23:	c7 45 f4 06 00 00 00 	movl   $0x6,-0xc(%ebp)
c0100b2a:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
    switch (regnum) {
c0100b31:	83 7d f4 07          	cmpl   $0x7,-0xc(%ebp)
c0100b35:	77 3c                	ja     c0100b73 <restore_all_dr+0xbe>
c0100b37:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b3a:	c1 e0 02             	shl    $0x2,%eax
c0100b3d:	8b 80 88 61 10 c0    	mov    -0x3fef9e78(%eax),%eax
c0100b43:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100b45:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b48:	0f 23 c0             	mov    %eax,%db0
c0100b4b:	eb 26                	jmp    c0100b73 <restore_all_dr+0xbe>
    case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100b4d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b50:	0f 23 c8             	mov    %eax,%db1
c0100b53:	eb 1e                	jmp    c0100b73 <restore_all_dr+0xbe>
    case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100b55:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b58:	0f 23 d0             	mov    %eax,%db2
c0100b5b:	eb 16                	jmp    c0100b73 <restore_all_dr+0xbe>
    case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100b5d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b60:	0f 23 d8             	mov    %eax,%db3
c0100b63:	eb 0e                	jmp    c0100b73 <restore_all_dr+0xbe>
    case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100b65:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b68:	0f 23 f0             	mov    %eax,%db6
c0100b6b:	eb 06                	jmp    c0100b73 <restore_all_dr+0xbe>
    case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100b6d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b70:	0f 23 f8             	mov    %eax,%db7
        write_dr(i, local_dr[i]);
    }
    write_dr(DR_STATUS, 0);
    write_dr(DR_CONTROL, control_dr);
c0100b73:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100b78:	c7 45 fc 07 00 00 00 	movl   $0x7,-0x4(%ebp)
c0100b7f:	89 45 f8             	mov    %eax,-0x8(%ebp)
    return value;
}

static void
write_dr(unsigned regnum, uint32_t value) {
    switch (regnum) {
c0100b82:	83 7d fc 07          	cmpl   $0x7,-0x4(%ebp)
c0100b86:	77 3c                	ja     c0100bc4 <restore_all_dr+0x10f>
c0100b88:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100b8b:	c1 e0 02             	shl    $0x2,%eax
c0100b8e:	8b 80 a8 61 10 c0    	mov    -0x3fef9e58(%eax),%eax
c0100b94:	ff e0                	jmp    *%eax
    case 0: asm volatile ("movl %0, %%db0" :: "r" (value)); break;
c0100b96:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100b99:	0f 23 c0             	mov    %eax,%db0
c0100b9c:	eb 26                	jmp    c0100bc4 <restore_all_dr+0x10f>
    case 1: asm volatile ("movl %0, %%db1" :: "r" (value)); break;
c0100b9e:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100ba1:	0f 23 c8             	mov    %eax,%db1
c0100ba4:	eb 1e                	jmp    c0100bc4 <restore_all_dr+0x10f>
    case 2: asm volatile ("movl %0, %%db2" :: "r" (value)); break;
c0100ba6:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100ba9:	0f 23 d0             	mov    %eax,%db2
c0100bac:	eb 16                	jmp    c0100bc4 <restore_all_dr+0x10f>
    case 3: asm volatile ("movl %0, %%db3" :: "r" (value)); break;
c0100bae:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100bb1:	0f 23 d8             	mov    %eax,%db3
c0100bb4:	eb 0e                	jmp    c0100bc4 <restore_all_dr+0x10f>
    case 6: asm volatile ("movl %0, %%db6" :: "r" (value)); break;
c0100bb6:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100bb9:	0f 23 f0             	mov    %eax,%db6
c0100bbc:	eb 06                	jmp    c0100bc4 <restore_all_dr+0x10f>
    case 7: asm volatile ("movl %0, %%db7" :: "r" (value)); break;
c0100bbe:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100bc1:	0f 23 f8             	mov    %eax,%db7
}
c0100bc4:	c9                   	leave  
c0100bc5:	c3                   	ret    

c0100bc6 <debug_enable_dr>:

/* debug_enable_dr - set and enable debug register @regnum locally */
int
debug_enable_dr(unsigned regnum, uintptr_t addr, unsigned type, unsigned len) {
c0100bc6:	55                   	push   %ebp
c0100bc7:	89 e5                	mov    %esp,%ebp
c0100bc9:	53                   	push   %ebx
c0100bca:	83 ec 10             	sub    $0x10,%esp
    if (regnum < MAX_DR_NUM) {
c0100bcd:	83 7d 08 03          	cmpl   $0x3,0x8(%ebp)
c0100bd1:	0f 87 ad 00 00 00    	ja     c0100c84 <debug_enable_dr+0xbe>
        local_dr[regnum] = addr;
c0100bd7:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bda:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100bdd:	89 14 85 a0 9e 11 c0 	mov    %edx,-0x3fee6160(,%eax,4)
        local_dr_counter[regnum] = 0;
c0100be4:	8b 45 08             	mov    0x8(%ebp),%eax
c0100be7:	c7 04 85 b8 9e 11 c0 	movl   $0x0,-0x3fee6148(,%eax,4)
c0100bee:	00 00 00 00 
        unsigned shift = (regnum * 4) + 16;
c0100bf2:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bf5:	83 c0 04             	add    $0x4,%eax
c0100bf8:	c1 e0 02             	shl    $0x2,%eax
c0100bfb:	89 45 f4             	mov    %eax,-0xc(%ebp)
        uint32_t mask = (0xF << shift);
c0100bfe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c01:	ba 0f 00 00 00       	mov    $0xf,%edx
c0100c06:	89 d3                	mov    %edx,%ebx
c0100c08:	89 c1                	mov    %eax,%ecx
c0100c0a:	d3 e3                	shl    %cl,%ebx
c0100c0c:	89 d8                	mov    %ebx,%eax
c0100c0e:	89 45 f8             	mov    %eax,-0x8(%ebp)
        control_dr &= ~mask;
c0100c11:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100c14:	89 c2                	mov    %eax,%edx
c0100c16:	f7 d2                	not    %edx
c0100c18:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100c1d:	21 d0                	and    %edx,%eax
c0100c1f:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        control_dr |= ((type & 3) << shift);
c0100c24:	8b 45 10             	mov    0x10(%ebp),%eax
c0100c27:	89 c2                	mov    %eax,%edx
c0100c29:	83 e2 03             	and    $0x3,%edx
c0100c2c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c2f:	89 c1                	mov    %eax,%ecx
c0100c31:	d3 e2                	shl    %cl,%edx
c0100c33:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100c38:	09 d0                	or     %edx,%eax
c0100c3a:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        control_dr |= ((len & 3) << (shift + 2));
c0100c3f:	8b 45 14             	mov    0x14(%ebp),%eax
c0100c42:	89 c2                	mov    %eax,%edx
c0100c44:	83 e2 03             	and    $0x3,%edx
c0100c47:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c4a:	83 c0 02             	add    $0x2,%eax
c0100c4d:	89 c1                	mov    %eax,%ecx
c0100c4f:	d3 e2                	shl    %cl,%edx
c0100c51:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100c56:	09 d0                	or     %edx,%eax
c0100c58:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        control_dr |= (1 << (regnum * 2));
c0100c5d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c60:	01 c0                	add    %eax,%eax
c0100c62:	ba 01 00 00 00       	mov    $0x1,%edx
c0100c67:	89 d3                	mov    %edx,%ebx
c0100c69:	89 c1                	mov    %eax,%ecx
c0100c6b:	d3 e3                	shl    %cl,%ebx
c0100c6d:	89 d8                	mov    %ebx,%eax
c0100c6f:	89 c2                	mov    %eax,%edx
c0100c71:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100c76:	09 d0                	or     %edx,%eax
c0100c78:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        return 0;
c0100c7d:	b8 00 00 00 00       	mov    $0x0,%eax
c0100c82:	eb 05                	jmp    c0100c89 <debug_enable_dr+0xc3>
    }
    return -1;
c0100c84:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c0100c89:	83 c4 10             	add    $0x10,%esp
c0100c8c:	5b                   	pop    %ebx
c0100c8d:	5d                   	pop    %ebp
c0100c8e:	c3                   	ret    

c0100c8f <debug_disable_dr>:

/* debug_disable_dr - disable debug register @regnum locally */
int
debug_disable_dr(unsigned regnum) {
c0100c8f:	55                   	push   %ebp
c0100c90:	89 e5                	mov    %esp,%ebp
c0100c92:	53                   	push   %ebx
c0100c93:	83 ec 10             	sub    $0x10,%esp
    if (regnum < MAX_DR_NUM) {
c0100c96:	83 7d 08 03          	cmpl   $0x3,0x8(%ebp)
c0100c9a:	77 5b                	ja     c0100cf7 <debug_disable_dr+0x68>
        unsigned shift = (regnum * 4) + 16;
c0100c9c:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c9f:	83 c0 04             	add    $0x4,%eax
c0100ca2:	c1 e0 02             	shl    $0x2,%eax
c0100ca5:	89 45 f4             	mov    %eax,-0xc(%ebp)
        uint32_t mask = (0xF << shift);
c0100ca8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100cab:	ba 0f 00 00 00       	mov    $0xf,%edx
c0100cb0:	89 d3                	mov    %edx,%ebx
c0100cb2:	89 c1                	mov    %eax,%ecx
c0100cb4:	d3 e3                	shl    %cl,%ebx
c0100cb6:	89 d8                	mov    %ebx,%eax
c0100cb8:	89 45 f8             	mov    %eax,-0x8(%ebp)
        control_dr &= ~mask;
c0100cbb:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100cbe:	89 c2                	mov    %eax,%edx
c0100cc0:	f7 d2                	not    %edx
c0100cc2:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100cc7:	21 d0                	and    %edx,%eax
c0100cc9:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        control_dr &= ~(1 << (regnum * 2));
c0100cce:	8b 45 08             	mov    0x8(%ebp),%eax
c0100cd1:	01 c0                	add    %eax,%eax
c0100cd3:	ba 01 00 00 00       	mov    $0x1,%edx
c0100cd8:	89 d3                	mov    %edx,%ebx
c0100cda:	89 c1                	mov    %eax,%ecx
c0100cdc:	d3 e3                	shl    %cl,%ebx
c0100cde:	89 d8                	mov    %ebx,%eax
c0100ce0:	f7 d0                	not    %eax
c0100ce2:	89 c2                	mov    %eax,%edx
c0100ce4:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100ce9:	21 d0                	and    %edx,%eax
c0100ceb:	a3 b4 9e 11 c0       	mov    %eax,0xc0119eb4
        return 0;
c0100cf0:	b8 00 00 00 00       	mov    $0x0,%eax
c0100cf5:	eb 05                	jmp    c0100cfc <debug_disable_dr+0x6d>
    }
    return -1;
c0100cf7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c0100cfc:	83 c4 10             	add    $0x10,%esp
c0100cff:	5b                   	pop    %ebx
c0100d00:	5d                   	pop    %ebp
c0100d01:	c3                   	ret    

c0100d02 <debug_init>:
// mark if local_dr, status_dr and contorl_dr are valid
static bool is_dr_saved = 0;

/* debug_init - init all debug registers by using restore_dr */
void
debug_init(void) {
c0100d02:	55                   	push   %ebp
c0100d03:	89 e5                	mov    %esp,%ebp
c0100d05:	83 ec 18             	sub    $0x18,%esp
    memset(local_dr, 0, sizeof(local_dr));
c0100d08:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0100d0f:	00 
c0100d10:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100d17:	00 
c0100d18:	c7 04 24 a0 9e 11 c0 	movl   $0xc0119ea0,(%esp)
c0100d1f:	e8 13 51 00 00       	call   c0105e37 <memset>
    memset(local_dr_counter, 0, sizeof(local_dr_counter));
c0100d24:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0100d2b:	00 
c0100d2c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100d33:	00 
c0100d34:	c7 04 24 b8 9e 11 c0 	movl   $0xc0119eb8,(%esp)
c0100d3b:	e8 f7 50 00 00       	call   c0105e37 <memset>
    control_dr = DR7_GEXACT | DR7_LEXACT;
c0100d40:	c7 05 b4 9e 11 c0 00 	movl   $0x300,0xc0119eb4
c0100d47:	03 00 00 
    restore_all_dr();
c0100d4a:	e8 66 fd ff ff       	call   c0100ab5 <restore_all_dr>
}
c0100d4f:	c9                   	leave  
c0100d50:	c3                   	ret    

c0100d51 <debug_list_dr>:

/* debug_list_dr - list and print all debug registrs' value and type */
void
debug_list_dr(void) {
c0100d51:	55                   	push   %ebp
c0100d52:	89 e5                	mov    %esp,%ebp
c0100d54:	53                   	push   %ebx
c0100d55:	83 ec 44             	sub    $0x44,%esp
    bool has = 0;
c0100d58:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    int regnum;
    for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100d5f:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0100d66:	e9 c8 00 00 00       	jmp    c0100e33 <debug_list_dr+0xe2>
        if (control_dr & (1 << (regnum * 2))) {
c0100d6b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100d6e:	01 c0                	add    %eax,%eax
c0100d70:	ba 01 00 00 00       	mov    $0x1,%edx
c0100d75:	89 d3                	mov    %edx,%ebx
c0100d77:	89 c1                	mov    %eax,%ecx
c0100d79:	d3 e3                	shl    %cl,%ebx
c0100d7b:	89 d8                	mov    %ebx,%eax
c0100d7d:	89 c2                	mov    %eax,%edx
c0100d7f:	a1 b4 9e 11 c0       	mov    0xc0119eb4,%eax
c0100d84:	21 d0                	and    %edx,%eax
c0100d86:	85 c0                	test   %eax,%eax
c0100d88:	0f 84 a1 00 00 00    	je     c0100e2f <debug_list_dr+0xde>
            if (!has) {
c0100d8e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0100d92:	75 13                	jne    c0100da7 <debug_list_dr+0x56>
                has = 1;
c0100d94:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
                cprintf("    Num Address    Type       Len    Count\n");
c0100d9b:	c7 04 24 04 62 10 c0 	movl   $0xc0106204,(%esp)
c0100da2:	e8 05 f4 ff ff       	call   c01001ac <cprintf>
            }
            unsigned shift = (regnum * 4) + 16;
c0100da7:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100daa:	83 c0 04             	add    $0x4,%eax
c0100dad:	c1 e0 02             	shl    $0x2,%eax
c0100db0:	89 45 ec             	mov    %eax,-0x14(%ebp)
            unsigned type = ((control_dr >> shift) & 3);
c0100db3:	8b 15 b4 9e 11 c0    	mov    0xc0119eb4,%edx
c0100db9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100dbc:	89 d3                	mov    %edx,%ebx
c0100dbe:	89 c1                	mov    %eax,%ecx
c0100dc0:	d3 eb                	shr    %cl,%ebx
c0100dc2:	89 d8                	mov    %ebx,%eax
c0100dc4:	83 e0 03             	and    $0x3,%eax
c0100dc7:	89 45 f0             	mov    %eax,-0x10(%ebp)
            unsigned len = ((control_dr >> (shift + 2)) & 3);
c0100dca:	8b 15 b4 9e 11 c0    	mov    0xc0119eb4,%edx
c0100dd0:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100dd3:	83 c0 02             	add    $0x2,%eax
c0100dd6:	89 d3                	mov    %edx,%ebx
c0100dd8:	89 c1                	mov    %eax,%ecx
c0100dda:	d3 eb                	shr    %cl,%ebx
c0100ddc:	89 d8                	mov    %ebx,%eax
c0100dde:	83 e0 03             	and    $0x3,%eax
c0100de1:	89 45 f4             	mov    %eax,-0xc(%ebp)
            cprintf("    %1d   0x%08x %-10s %6s %d\n", regnum, local_dr[regnum],
c0100de4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100de7:	8b 1c 85 b8 9e 11 c0 	mov    -0x3fee6148(,%eax,4),%ebx
c0100dee:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100df1:	8b 0c 85 30 90 11 c0 	mov    -0x3fee6fd0(,%eax,4),%ecx
c0100df8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100dfb:	8b 14 85 20 90 11 c0 	mov    -0x3fee6fe0(,%eax,4),%edx
c0100e02:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100e05:	8b 04 85 a0 9e 11 c0 	mov    -0x3fee6160(,%eax,4),%eax
c0100e0c:	89 5c 24 14          	mov    %ebx,0x14(%esp)
c0100e10:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c0100e14:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0100e18:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100e1c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100e1f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100e23:	c7 04 24 30 62 10 c0 	movl   $0xc0106230,(%esp)
c0100e2a:	e8 7d f3 ff ff       	call   c01001ac <cprintf>
/* debug_list_dr - list and print all debug registrs' value and type */
void
debug_list_dr(void) {
    bool has = 0;
    int regnum;
    for (regnum = 0; regnum < MAX_DR_NUM; regnum ++) {
c0100e2f:	83 45 e8 01          	addl   $0x1,-0x18(%ebp)
c0100e33:	83 7d e8 03          	cmpl   $0x3,-0x18(%ebp)
c0100e37:	0f 8e 2e ff ff ff    	jle    c0100d6b <debug_list_dr+0x1a>
            unsigned len = ((control_dr >> (shift + 2)) & 3);
            cprintf("    %1d   0x%08x %-10s %6s %d\n", regnum, local_dr[regnum],
                    BreakDescription[type], BreakLengthDescription[len], local_dr_counter[regnum]);
        }
    }
    if (!has) {
c0100e3d:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0100e41:	75 0c                	jne    c0100e4f <debug_list_dr+0xfe>
        cprintf("no breakpoints or watchpoints.\n");
c0100e43:	c7 04 24 50 62 10 c0 	movl   $0xc0106250,(%esp)
c0100e4a:	e8 5d f3 ff ff       	call   c01001ac <cprintf>
    }
}
c0100e4f:	83 c4 44             	add    $0x44,%esp
c0100e52:	5b                   	pop    %ebx
c0100e53:	5d                   	pop    %ebp
c0100e54:	c3                   	ret    

c0100e55 <debug_start>:
 * type 'step' to decide to run a single step, debug_end won't restore all these
 * debug registers, and keep the value of 'is_dr_saved'. When another debug interrupt
 * occurs, it may go into this function again.
 * */
static void
debug_start(struct trapframe *tf) {
c0100e55:	55                   	push   %ebp
c0100e56:	89 e5                	mov    %esp,%ebp
    if (!is_dr_saved) {
c0100e58:	a1 c8 9e 11 c0       	mov    0xc0119ec8,%eax
c0100e5d:	85 c0                	test   %eax,%eax
c0100e5f:	75 0f                	jne    c0100e70 <debug_start+0x1b>
        is_dr_saved = 1;
c0100e61:	c7 05 c8 9e 11 c0 01 	movl   $0x1,0xc0119ec8
c0100e68:	00 00 00 
        save_all_dr();
c0100e6b:	e8 85 fa ff ff       	call   c01008f5 <save_all_dr>
    }
}
c0100e70:	5d                   	pop    %ebp
c0100e71:	c3                   	ret    

c0100e72 <debug_end>:
/* *
 * debug_end - restore all debug registers if necessory. Note that, if kernel
 * needs to run a single step, it should not restore them.
 * */
static void
debug_end(struct trapframe *tf) {
c0100e72:	55                   	push   %ebp
c0100e73:	89 e5                	mov    %esp,%ebp
    if (!(tf->tf_eflags & FL_TF) && is_dr_saved) {
c0100e75:	8b 45 08             	mov    0x8(%ebp),%eax
c0100e78:	8b 40 38             	mov    0x38(%eax),%eax
c0100e7b:	25 00 01 00 00       	and    $0x100,%eax
c0100e80:	85 c0                	test   %eax,%eax
c0100e82:	75 18                	jne    c0100e9c <debug_end+0x2a>
c0100e84:	a1 c8 9e 11 c0       	mov    0xc0119ec8,%eax
c0100e89:	85 c0                	test   %eax,%eax
c0100e8b:	74 0f                	je     c0100e9c <debug_end+0x2a>
        is_dr_saved = 0;
c0100e8d:	c7 05 c8 9e 11 c0 00 	movl   $0x0,0xc0119ec8
c0100e94:	00 00 00 
        restore_all_dr();
c0100e97:	e8 19 fc ff ff       	call   c0100ab5 <restore_all_dr>
    }
}
c0100e9c:	5d                   	pop    %ebp
c0100e9d:	c3                   	ret    

c0100e9e <debug_monitor>:

/* debug_monitor - goes into the debugger monitor, and type 'continue' to return */
void
debug_monitor(struct trapframe *tf) {
c0100e9e:	55                   	push   %ebp
c0100e9f:	89 e5                	mov    %esp,%ebp
c0100ea1:	83 ec 28             	sub    $0x28,%esp
    assert(tf != NULL);
c0100ea4:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100ea8:	75 24                	jne    c0100ece <debug_monitor+0x30>
c0100eaa:	c7 44 24 0c 70 62 10 	movl   $0xc0106270,0xc(%esp)
c0100eb1:	c0 
c0100eb2:	c7 44 24 08 7b 62 10 	movl   $0xc010627b,0x8(%esp)
c0100eb9:	c0 
c0100eba:	c7 44 24 04 c9 01 00 	movl   $0x1c9,0x4(%esp)
c0100ec1:	00 
c0100ec2:	c7 04 24 90 62 10 c0 	movl   $0xc0106290,(%esp)
c0100ec9:	e8 c2 07 00 00       	call   c0101690 <__panic>
    bool intr_flag;
    local_intr_save(intr_flag);
c0100ece:	e8 7d f3 ff ff       	call   c0100250 <__intr_save>
c0100ed3:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        debug_start(tf);
c0100ed6:	8b 45 08             	mov    0x8(%ebp),%eax
c0100ed9:	89 04 24             	mov    %eax,(%esp)
c0100edc:	e8 74 ff ff ff       	call   c0100e55 <debug_start>
        cprintf("debug_monitor at:\n");
c0100ee1:	c7 04 24 a4 62 10 c0 	movl   $0xc01062a4,(%esp)
c0100ee8:	e8 bf f2 ff ff       	call   c01001ac <cprintf>
        print_debuginfo(tf->tf_eip);
c0100eed:	8b 45 08             	mov    0x8(%ebp),%eax
c0100ef0:	8b 40 30             	mov    0x30(%eax),%eax
c0100ef3:	89 04 24             	mov    %eax,(%esp)
c0100ef6:	e8 92 f8 ff ff       	call   c010078d <print_debuginfo>
        monitor(tf);
c0100efb:	8b 45 08             	mov    0x8(%ebp),%eax
c0100efe:	89 04 24             	mov    %eax,(%esp)
c0100f01:	e8 77 01 00 00       	call   c010107d <monitor>
        debug_end(tf);
c0100f06:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f09:	89 04 24             	mov    %eax,(%esp)
c0100f0c:	e8 61 ff ff ff       	call   c0100e72 <debug_end>
    }
    local_intr_restore(intr_flag);
c0100f11:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100f14:	89 04 24             	mov    %eax,(%esp)
c0100f17:	e8 5e f3 ff ff       	call   c010027a <__intr_restore>
}
c0100f1c:	c9                   	leave  
c0100f1d:	c3                   	ret    
	...

c0100f20 <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c0100f20:	55                   	push   %ebp
c0100f21:	89 e5                	mov    %esp,%ebp
c0100f23:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
c0100f26:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100f2d:	eb 0a                	jmp    c0100f39 <parse+0x19>
            *buf ++ = '\0';
c0100f2f:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f32:	c6 00 00             	movb   $0x0,(%eax)
c0100f35:	83 45 08 01          	addl   $0x1,0x8(%ebp)
static int
parse(char *buf, char **argv) {
    int argc = 0;
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100f39:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f3c:	0f b6 00             	movzbl (%eax),%eax
c0100f3f:	84 c0                	test   %al,%al
c0100f41:	74 1d                	je     c0100f60 <parse+0x40>
c0100f43:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f46:	0f b6 00             	movzbl (%eax),%eax
c0100f49:	0f be c0             	movsbl %al,%eax
c0100f4c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100f50:	c7 04 24 e5 65 10 c0 	movl   $0xc01065e5,(%esp)
c0100f57:	e8 20 4d 00 00       	call   c0105c7c <strchr>
c0100f5c:	85 c0                	test   %eax,%eax
c0100f5e:	75 cf                	jne    c0100f2f <parse+0xf>
            *buf ++ = '\0';
        }
        if (*buf == '\0') {
c0100f60:	8b 45 08             	mov    0x8(%ebp),%eax
c0100f63:	0f b6 00             	movzbl (%eax),%eax
c0100f66:	84 c0                	test   %al,%al
c0100f68:	75 05                	jne    c0100f6f <parse+0x4f>
        argv[argc ++] = buf;
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
            buf ++;
        }
    }
    return argc;
c0100f6a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100f6d:	c9                   	leave  
c0100f6e:	c3                   	ret    
        if (*buf == '\0') {
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
c0100f6f:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100f73:	75 14                	jne    c0100f89 <parse+0x69>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100f75:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
c0100f7c:	00 
c0100f7d:	c7 04 24 ea 65 10 c0 	movl   $0xc01065ea,(%esp)
c0100f84:	e8 23 f2 ff ff       	call   c01001ac <cprintf>
        }
        argv[argc ++] = buf;
c0100f89:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100f8c:	c1 e0 02             	shl    $0x2,%eax
c0100f8f:	03 45 0c             	add    0xc(%ebp),%eax
c0100f92:	8b 55 08             	mov    0x8(%ebp),%edx
c0100f95:	89 10                	mov    %edx,(%eax)
c0100f97:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100f9b:	eb 04                	jmp    c0100fa1 <parse+0x81>
            buf ++;
c0100f9d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
        // save and scan past next arg
        if (argc == MAXARGS - 1) {
            cprintf("Too many arguments (max %d).\n", MAXARGS);
        }
        argv[argc ++] = buf;
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100fa1:	8b 45 08             	mov    0x8(%ebp),%eax
c0100fa4:	0f b6 00             	movzbl (%eax),%eax
c0100fa7:	84 c0                	test   %al,%al
c0100fa9:	74 1d                	je     c0100fc8 <parse+0xa8>
c0100fab:	8b 45 08             	mov    0x8(%ebp),%eax
c0100fae:	0f b6 00             	movzbl (%eax),%eax
c0100fb1:	0f be c0             	movsbl %al,%eax
c0100fb4:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100fb8:	c7 04 24 e5 65 10 c0 	movl   $0xc01065e5,(%esp)
c0100fbf:	e8 b8 4c 00 00       	call   c0105c7c <strchr>
c0100fc4:	85 c0                	test   %eax,%eax
c0100fc6:	74 d5                	je     c0100f9d <parse+0x7d>
            buf ++;
        }
    }
c0100fc8:	90                   	nop
static int
parse(char *buf, char **argv) {
    int argc = 0;
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100fc9:	e9 6b ff ff ff       	jmp    c0100f39 <parse+0x19>

c0100fce <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100fce:	55                   	push   %ebp
c0100fcf:	89 e5                	mov    %esp,%ebp
c0100fd1:	83 ec 68             	sub    $0x68,%esp
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
c0100fd4:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100fd7:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100fdb:	8b 45 08             	mov    0x8(%ebp),%eax
c0100fde:	89 04 24             	mov    %eax,(%esp)
c0100fe1:	e8 3a ff ff ff       	call   c0100f20 <parse>
c0100fe6:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
c0100fe9:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100fed:	75 0a                	jne    c0100ff9 <runcmd+0x2b>
        return 0;
c0100fef:	b8 00 00 00 00       	mov    $0x0,%eax
c0100ff4:	e9 82 00 00 00       	jmp    c010107b <runcmd+0xad>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100ff9:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0101000:	eb 59                	jmp    c010105b <runcmd+0x8d>
        if (strcmp(commands[i].name, argv[0]) == 0) {
c0101002:	8b 4d b0             	mov    -0x50(%ebp),%ecx
c0101005:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101008:	89 d0                	mov    %edx,%eax
c010100a:	01 c0                	add    %eax,%eax
c010100c:	01 d0                	add    %edx,%eax
c010100e:	c1 e0 02             	shl    $0x2,%eax
c0101011:	8b 80 40 90 11 c0    	mov    -0x3fee6fc0(%eax),%eax
c0101017:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c010101b:	89 04 24             	mov    %eax,(%esp)
c010101e:	e8 b8 4b 00 00       	call   c0105bdb <strcmp>
c0101023:	85 c0                	test   %eax,%eax
c0101025:	75 30                	jne    c0101057 <runcmd+0x89>
            return commands[i].func(argc - 1, argv + 1, tf);
c0101027:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010102a:	89 d0                	mov    %edx,%eax
c010102c:	01 c0                	add    %eax,%eax
c010102e:	01 d0                	add    %edx,%eax
c0101030:	c1 e0 02             	shl    $0x2,%eax
c0101033:	8b 90 48 90 11 c0    	mov    -0x3fee6fb8(%eax),%edx
c0101039:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010103c:	8d 48 ff             	lea    -0x1(%eax),%ecx
c010103f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101042:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101046:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0101049:	83 c0 04             	add    $0x4,%eax
c010104c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101050:	89 0c 24             	mov    %ecx,(%esp)
c0101053:	ff d2                	call   *%edx
c0101055:	eb 24                	jmp    c010107b <runcmd+0xad>
    int argc = parse(buf, argv);
    if (argc == 0) {
        return 0;
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0101057:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010105b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010105e:	83 f8 08             	cmp    $0x8,%eax
c0101061:	76 9f                	jbe    c0101002 <runcmd+0x34>
        if (strcmp(commands[i].name, argv[0]) == 0) {
            return commands[i].func(argc - 1, argv + 1, tf);
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
c0101063:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0101066:	89 44 24 04          	mov    %eax,0x4(%esp)
c010106a:	c7 04 24 08 66 10 c0 	movl   $0xc0106608,(%esp)
c0101071:	e8 36 f1 ff ff       	call   c01001ac <cprintf>
    return 0;
c0101076:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010107b:	c9                   	leave  
c010107c:	c3                   	ret    

c010107d <monitor>:

/***** Implementations of basic kernel monitor commands *****/

void
monitor(struct trapframe *tf) {
c010107d:	55                   	push   %ebp
c010107e:	89 e5                	mov    %esp,%ebp
c0101080:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
c0101083:	c7 04 24 20 66 10 c0 	movl   $0xc0106620,(%esp)
c010108a:	e8 1d f1 ff ff       	call   c01001ac <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
c010108f:	c7 04 24 48 66 10 c0 	movl   $0xc0106648,(%esp)
c0101096:	e8 11 f1 ff ff       	call   c01001ac <cprintf>

    if (tf != NULL) {
c010109b:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010109f:	74 11                	je     c01010b2 <monitor+0x35>
        print_trapframe(tf);
c01010a1:	8b 45 08             	mov    0x8(%ebp),%eax
c01010a4:	89 04 24             	mov    %eax,(%esp)
c01010a7:	e8 1b 13 00 00       	call   c01023c7 <print_trapframe>
c01010ac:	eb 04                	jmp    c01010b2 <monitor+0x35>
        if ((buf = readline("K> ")) != NULL) {
            if (runcmd(buf, tf) < 0) {
                break;
            }
        }
    }
c01010ae:	90                   	nop
c01010af:	eb 01                	jmp    c01010b2 <monitor+0x35>
c01010b1:	90                   	nop
        print_trapframe(tf);
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
c01010b2:	c7 04 24 6d 66 10 c0 	movl   $0xc010666d,(%esp)
c01010b9:	e8 e2 ef ff ff       	call   c01000a0 <readline>
c01010be:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01010c1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01010c5:	74 e7                	je     c01010ae <monitor+0x31>
            if (runcmd(buf, tf) < 0) {
c01010c7:	8b 45 08             	mov    0x8(%ebp),%eax
c01010ca:	89 44 24 04          	mov    %eax,0x4(%esp)
c01010ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01010d1:	89 04 24             	mov    %eax,(%esp)
c01010d4:	e8 f5 fe ff ff       	call   c0100fce <runcmd>
c01010d9:	85 c0                	test   %eax,%eax
c01010db:	79 d4                	jns    c01010b1 <monitor+0x34>
                break;
            }
        }
    }
}
c01010dd:	90                   	nop
c01010de:	c9                   	leave  
c01010df:	c3                   	ret    

c01010e0 <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c01010e0:	55                   	push   %ebp
c01010e1:	89 e5                	mov    %esp,%ebp
c01010e3:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c01010e6:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01010ed:	eb 3c                	jmp    c010112b <mon_help+0x4b>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c01010ef:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01010f2:	89 d0                	mov    %edx,%eax
c01010f4:	01 c0                	add    %eax,%eax
c01010f6:	01 d0                	add    %edx,%eax
c01010f8:	c1 e0 02             	shl    $0x2,%eax
c01010fb:	8b 88 44 90 11 c0    	mov    -0x3fee6fbc(%eax),%ecx
c0101101:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101104:	89 d0                	mov    %edx,%eax
c0101106:	01 c0                	add    %eax,%eax
c0101108:	01 d0                	add    %edx,%eax
c010110a:	c1 e0 02             	shl    $0x2,%eax
c010110d:	8b 80 40 90 11 c0    	mov    -0x3fee6fc0(%eax),%eax
c0101113:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0101117:	89 44 24 04          	mov    %eax,0x4(%esp)
c010111b:	c7 04 24 71 66 10 c0 	movl   $0xc0106671,(%esp)
c0101122:	e8 85 f0 ff ff       	call   c01001ac <cprintf>

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0101127:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c010112b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010112e:	83 f8 08             	cmp    $0x8,%eax
c0101131:	76 bc                	jbe    c01010ef <mon_help+0xf>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
    }
    return 0;
c0101133:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0101138:	c9                   	leave  
c0101139:	c3                   	ret    

c010113a <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c010113a:	55                   	push   %ebp
c010113b:	89 e5                	mov    %esp,%ebp
c010113d:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
c0101140:	e8 b0 f5 ff ff       	call   c01006f5 <print_kerninfo>
    return 0;
c0101145:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010114a:	c9                   	leave  
c010114b:	c3                   	ret    

c010114c <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c010114c:	55                   	push   %ebp
c010114d:	89 e5                	mov    %esp,%ebp
c010114f:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
c0101152:	e8 e5 f6 ff ff       	call   c010083c <print_stackframe>
    return 0;
c0101157:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010115c:	c9                   	leave  
c010115d:	c3                   	ret    

c010115e <mon_continue>:

/* mon_continue - continue execution if it isn't kernel panic */
int
mon_continue(int argc, char **argv, struct trapframe *tf) {
c010115e:	55                   	push   %ebp
c010115f:	89 e5                	mov    %esp,%ebp
c0101161:	83 ec 18             	sub    $0x18,%esp
    if (is_kernel_panic()) {
c0101164:	e8 da 05 00 00       	call   c0101743 <is_kernel_panic>
c0101169:	85 c0                	test   %eax,%eax
c010116b:	74 13                	je     c0101180 <mon_continue+0x22>
        cprintf("can't continue execution in kernel panic.\n");
c010116d:	c7 04 24 7c 66 10 c0 	movl   $0xc010667c,(%esp)
c0101174:	e8 33 f0 ff ff       	call   c01001ac <cprintf>
        return 0;
c0101179:	b8 00 00 00 00       	mov    $0x0,%eax
c010117e:	eb 1c                	jmp    c010119c <mon_continue+0x3e>
    }
    if (tf != NULL) {
c0101180:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0101184:	74 11                	je     c0101197 <mon_continue+0x39>
        tf->tf_eflags &= ~FL_TF;
c0101186:	8b 45 10             	mov    0x10(%ebp),%eax
c0101189:	8b 40 38             	mov    0x38(%eax),%eax
c010118c:	89 c2                	mov    %eax,%edx
c010118e:	80 e6 fe             	and    $0xfe,%dh
c0101191:	8b 45 10             	mov    0x10(%ebp),%eax
c0101194:	89 50 38             	mov    %edx,0x38(%eax)
    }
    return -1;
c0101197:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
c010119c:	c9                   	leave  
c010119d:	c3                   	ret    

c010119e <mon_step>:

/* mon_step - run a single step */
int
mon_step(int argc, char **argv, struct trapframe *tf) {
c010119e:	55                   	push   %ebp
c010119f:	89 e5                	mov    %esp,%ebp
c01011a1:	83 ec 18             	sub    $0x18,%esp
    if (is_kernel_panic()) {
c01011a4:	e8 9a 05 00 00       	call   c0101743 <is_kernel_panic>
c01011a9:	85 c0                	test   %eax,%eax
c01011ab:	74 13                	je     c01011c0 <mon_step+0x22>
        cprintf("can't continue execution in kernel panic.\n");
c01011ad:	c7 04 24 7c 66 10 c0 	movl   $0xc010667c,(%esp)
c01011b4:	e8 f3 ef ff ff       	call   c01001ac <cprintf>
        return 0;
c01011b9:	b8 00 00 00 00       	mov    $0x0,%eax
c01011be:	eb 2f                	jmp    c01011ef <mon_step+0x51>
    }
    if (tf != NULL) {
c01011c0:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01011c4:	74 18                	je     c01011de <mon_step+0x40>
        tf->tf_eflags |= FL_TF;
c01011c6:	8b 45 10             	mov    0x10(%ebp),%eax
c01011c9:	8b 40 38             	mov    0x38(%eax),%eax
c01011cc:	89 c2                	mov    %eax,%edx
c01011ce:	80 ce 01             	or     $0x1,%dh
c01011d1:	8b 45 10             	mov    0x10(%ebp),%eax
c01011d4:	89 50 38             	mov    %edx,0x38(%eax)
        return -1;
c01011d7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01011dc:	eb 11                	jmp    c01011ef <mon_step+0x51>
    }
    cprintf("trapframe is NULL, can't run step.\n");
c01011de:	c7 04 24 a8 66 10 c0 	movl   $0xc01066a8,(%esp)
c01011e5:	e8 c2 ef ff ff       	call   c01001ac <cprintf>
    return 0;
c01011ea:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01011ef:	c9                   	leave  
c01011f0:	c3                   	ret    

c01011f1 <mon_breakpoint>:

/* mon_breakpoint - set a breakpoint */
int
mon_breakpoint(int argc, char **argv, struct trapframe *tf) {
c01011f1:	55                   	push   %ebp
c01011f2:	89 e5                	mov    %esp,%ebp
c01011f4:	83 ec 38             	sub    $0x38,%esp
    if (argc != 2) {
c01011f7:	83 7d 08 02          	cmpl   $0x2,0x8(%ebp)
c01011fb:	74 16                	je     c0101213 <mon_breakpoint+0x22>
        cprintf("needs 2 parameter(s).\n");
c01011fd:	c7 04 24 cc 66 10 c0 	movl   $0xc01066cc,(%esp)
c0101204:	e8 a3 ef ff ff       	call   c01001ac <cprintf>
        return 0;
c0101209:	b8 00 00 00 00       	mov    $0x0,%eax
c010120e:	e9 68 01 00 00       	jmp    c010137b <mon_breakpoint+0x18a>
    }
    uintptr_t addr;
    unsigned regnum = MAX_DR_NUM, type = 0, len = 3;
c0101213:	c7 45 e4 04 00 00 00 	movl   $0x4,-0x1c(%ebp)
c010121a:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0101221:	c7 45 ec 03 00 00 00 	movl   $0x3,-0x14(%ebp)
    int i;
    for (i = 0; i < argc; i ++) {
c0101228:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c010122f:	e9 b6 00 00 00       	jmp    c01012ea <mon_breakpoint+0xf9>
        if (argv[i][0] == '-') {
c0101234:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101237:	c1 e0 02             	shl    $0x2,%eax
c010123a:	03 45 0c             	add    0xc(%ebp),%eax
c010123d:	8b 00                	mov    (%eax),%eax
c010123f:	0f b6 00             	movzbl (%eax),%eax
c0101242:	3c 2d                	cmp    $0x2d,%al
c0101244:	75 71                	jne    c01012b7 <mon_breakpoint+0xc6>
            if (argv[i][1] != 'r' || strlen(argv[i]) != 3) {
c0101246:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101249:	c1 e0 02             	shl    $0x2,%eax
c010124c:	03 45 0c             	add    0xc(%ebp),%eax
c010124f:	8b 00                	mov    (%eax),%eax
c0101251:	83 c0 01             	add    $0x1,%eax
c0101254:	0f b6 00             	movzbl (%eax),%eax
c0101257:	3c 72                	cmp    $0x72,%al
c0101259:	0f 85 f5 00 00 00    	jne    c0101354 <mon_breakpoint+0x163>
c010125f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101262:	c1 e0 02             	shl    $0x2,%eax
c0101265:	03 45 0c             	add    0xc(%ebp),%eax
c0101268:	8b 00                	mov    (%eax),%eax
c010126a:	89 04 24             	mov    %eax,(%esp)
c010126d:	e8 92 48 00 00       	call   c0105b04 <strlen>
c0101272:	83 f8 03             	cmp    $0x3,%eax
c0101275:	0f 85 d9 00 00 00    	jne    c0101354 <mon_breakpoint+0x163>
                goto bad_argv;
            }
            else {
                switch (argv[i][2]) {
c010127b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010127e:	c1 e0 02             	shl    $0x2,%eax
c0101281:	03 45 0c             	add    0xc(%ebp),%eax
c0101284:	8b 00                	mov    (%eax),%eax
c0101286:	83 c0 02             	add    $0x2,%eax
c0101289:	0f b6 00             	movzbl (%eax),%eax
c010128c:	0f be c0             	movsbl %al,%eax
c010128f:	83 e8 30             	sub    $0x30,%eax
c0101292:	83 f8 03             	cmp    $0x3,%eax
c0101295:	0f 87 b5 00 00 00    	ja     c0101350 <mon_breakpoint+0x15f>
                case '0' ... '3': regnum = argv[i][2] - '0'; break;
c010129b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010129e:	c1 e0 02             	shl    $0x2,%eax
c01012a1:	03 45 0c             	add    0xc(%ebp),%eax
c01012a4:	8b 00                	mov    (%eax),%eax
c01012a6:	83 c0 02             	add    $0x2,%eax
c01012a9:	0f b6 00             	movzbl (%eax),%eax
c01012ac:	0f be c0             	movsbl %al,%eax
c01012af:	83 e8 30             	sub    $0x30,%eax
c01012b2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01012b5:	eb 2f                	jmp    c01012e6 <mon_breakpoint+0xf5>
                }
            }
        }
        else {
            char *endptr;
            addr = strtol(argv[i], &endptr, 16);
c01012b7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01012ba:	c1 e0 02             	shl    $0x2,%eax
c01012bd:	03 45 0c             	add    0xc(%ebp),%eax
c01012c0:	8b 00                	mov    (%eax),%eax
c01012c2:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c01012c9:	00 
c01012ca:	8d 55 dc             	lea    -0x24(%ebp),%edx
c01012cd:	89 54 24 04          	mov    %edx,0x4(%esp)
c01012d1:	89 04 24             	mov    %eax,(%esp)
c01012d4:	e8 05 4a 00 00       	call   c0105cde <strtol>
c01012d9:	89 45 e0             	mov    %eax,-0x20(%ebp)
            if (*endptr != '\0') {
c01012dc:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01012df:	0f b6 00             	movzbl (%eax),%eax
c01012e2:	84 c0                	test   %al,%al
c01012e4:	75 6d                	jne    c0101353 <mon_breakpoint+0x162>
        return 0;
    }
    uintptr_t addr;
    unsigned regnum = MAX_DR_NUM, type = 0, len = 3;
    int i;
    for (i = 0; i < argc; i ++) {
c01012e6:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
c01012ea:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01012ed:	3b 45 08             	cmp    0x8(%ebp),%eax
c01012f0:	0f 8c 3e ff ff ff    	jl     c0101234 <mon_breakpoint+0x43>
            if (*endptr != '\0') {
                goto bad_argv;
            }
        }
    }
    int ret = debug_enable_dr(regnum, addr, type, len);
c01012f6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01012f9:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01012fd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0101300:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101304:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0101307:	89 44 24 04          	mov    %eax,0x4(%esp)
c010130b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010130e:	89 04 24             	mov    %eax,(%esp)
c0101311:	e8 b0 f8 ff ff       	call   c0100bc6 <debug_enable_dr>
c0101316:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("set breakpoint [%d] at 0x%08x: %s.\n", regnum, addr,
c0101319:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010131d:	75 07                	jne    c0101326 <mon_breakpoint+0x135>
c010131f:	b8 e3 66 10 c0       	mov    $0xc01066e3,%eax
c0101324:	eb 05                	jmp    c010132b <mon_breakpoint+0x13a>
c0101326:	b8 ed 66 10 c0       	mov    $0xc01066ed,%eax
c010132b:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010132f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0101332:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101336:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101339:	89 44 24 04          	mov    %eax,0x4(%esp)
c010133d:	c7 04 24 f4 66 10 c0 	movl   $0xc01066f4,(%esp)
c0101344:	e8 63 ee ff ff       	call   c01001ac <cprintf>
            (ret == 0) ? "successed" : "failed");
    return 0;
c0101349:	b8 00 00 00 00       	mov    $0x0,%eax
c010134e:	eb 2b                	jmp    c010137b <mon_breakpoint+0x18a>
                goto bad_argv;
            }
            else {
                switch (argv[i][2]) {
                case '0' ... '3': regnum = argv[i][2] - '0'; break;
                default: goto bad_argv;
c0101350:	90                   	nop
c0101351:	eb 01                	jmp    c0101354 <mon_breakpoint+0x163>
        }
        else {
            char *endptr;
            addr = strtol(argv[i], &endptr, 16);
            if (*endptr != '\0') {
                goto bad_argv;
c0101353:	90                   	nop
    cprintf("set breakpoint [%d] at 0x%08x: %s.\n", regnum, addr,
            (ret == 0) ? "successed" : "failed");
    return 0;

bad_argv:
    cprintf("unknow parameter(s): [%d] %s\n", i, argv[i]);
c0101354:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101357:	c1 e0 02             	shl    $0x2,%eax
c010135a:	03 45 0c             	add    0xc(%ebp),%eax
c010135d:	8b 00                	mov    (%eax),%eax
c010135f:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101363:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101366:	89 44 24 04          	mov    %eax,0x4(%esp)
c010136a:	c7 04 24 18 67 10 c0 	movl   $0xc0106718,(%esp)
c0101371:	e8 36 ee ff ff       	call   c01001ac <cprintf>
    return 0;
c0101376:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010137b:	c9                   	leave  
c010137c:	c3                   	ret    

c010137d <mon_watchpoint>:

/* mon_watchpoint - set a watchpoint */
int
mon_watchpoint(int argc, char **argv, struct trapframe *tf) {
c010137d:	55                   	push   %ebp
c010137e:	89 e5                	mov    %esp,%ebp
c0101380:	83 ec 38             	sub    $0x38,%esp
    if (argc < 2) {
c0101383:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c0101387:	7f 16                	jg     c010139f <mon_watchpoint+0x22>
        cprintf("needs at least 2 parameter(s).\n");
c0101389:	c7 04 24 38 67 10 c0 	movl   $0xc0106738,(%esp)
c0101390:	e8 17 ee ff ff       	call   c01001ac <cprintf>
        return 0;
c0101395:	b8 00 00 00 00       	mov    $0x0,%eax
c010139a:	e9 16 02 00 00       	jmp    c01015b5 <mon_watchpoint+0x238>
    }
    uintptr_t addr;
    unsigned regnum = MAX_DR_NUM, type = 1, len = 3;
c010139f:	c7 45 e0 04 00 00 00 	movl   $0x4,-0x20(%ebp)
c01013a6:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
c01013ad:	c7 45 e8 03 00 00 00 	movl   $0x3,-0x18(%ebp)
    int i;
    for (i = 0; i < argc; i ++) {
c01013b4:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c01013bb:	e9 5e 01 00 00       	jmp    c010151e <mon_watchpoint+0x1a1>
        if (argv[i][0] == '-') {
c01013c0:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01013c3:	c1 e0 02             	shl    $0x2,%eax
c01013c6:	03 45 0c             	add    0xc(%ebp),%eax
c01013c9:	8b 00                	mov    (%eax),%eax
c01013cb:	0f b6 00             	movzbl (%eax),%eax
c01013ce:	3c 2d                	cmp    $0x2d,%al
c01013d0:	0f 85 15 01 00 00    	jne    c01014eb <mon_watchpoint+0x16e>
            char c = argv[i][1];
c01013d6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01013d9:	c1 e0 02             	shl    $0x2,%eax
c01013dc:	03 45 0c             	add    0xc(%ebp),%eax
c01013df:	8b 00                	mov    (%eax),%eax
c01013e1:	83 c0 01             	add    $0x1,%eax
c01013e4:	0f b6 00             	movzbl (%eax),%eax
c01013e7:	88 45 f7             	mov    %al,-0x9(%ebp)
            if ((c != 'r' && c != 't' && c != 'l') || strlen(argv[i]) != 3) {
c01013ea:	80 7d f7 72          	cmpb   $0x72,-0x9(%ebp)
c01013ee:	74 10                	je     c0101400 <mon_watchpoint+0x83>
c01013f0:	80 7d f7 74          	cmpb   $0x74,-0x9(%ebp)
c01013f4:	74 0a                	je     c0101400 <mon_watchpoint+0x83>
c01013f6:	80 7d f7 6c          	cmpb   $0x6c,-0x9(%ebp)
c01013fa:	0f 85 8e 01 00 00    	jne    c010158e <mon_watchpoint+0x211>
c0101400:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101403:	c1 e0 02             	shl    $0x2,%eax
c0101406:	03 45 0c             	add    0xc(%ebp),%eax
c0101409:	8b 00                	mov    (%eax),%eax
c010140b:	89 04 24             	mov    %eax,(%esp)
c010140e:	e8 f1 46 00 00       	call   c0105b04 <strlen>
c0101413:	83 f8 03             	cmp    $0x3,%eax
c0101416:	0f 85 72 01 00 00    	jne    c010158e <mon_watchpoint+0x211>
                goto bad_argv;
            }
            switch (c) {
c010141c:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101420:	83 f8 72             	cmp    $0x72,%eax
c0101423:	74 0f                	je     c0101434 <mon_watchpoint+0xb7>
c0101425:	83 f8 74             	cmp    $0x74,%eax
c0101428:	74 49                	je     c0101473 <mon_watchpoint+0xf6>
c010142a:	83 f8 6c             	cmp    $0x6c,%eax
c010142d:	74 79                	je     c01014a8 <mon_watchpoint+0x12b>
            case 'l':
                switch (argv[i][2]) {
                case '1': len = 0; break;
                case '2': len = 1; break;
                case '4': len = 3; break;
                default: goto bad_argv;
c010142f:	e9 e6 00 00 00       	jmp    c010151a <mon_watchpoint+0x19d>
            if ((c != 'r' && c != 't' && c != 'l') || strlen(argv[i]) != 3) {
                goto bad_argv;
            }
            switch (c) {
            case 'r':
                switch (argv[i][2]) {
c0101434:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101437:	c1 e0 02             	shl    $0x2,%eax
c010143a:	03 45 0c             	add    0xc(%ebp),%eax
c010143d:	8b 00                	mov    (%eax),%eax
c010143f:	83 c0 02             	add    $0x2,%eax
c0101442:	0f b6 00             	movzbl (%eax),%eax
c0101445:	0f be c0             	movsbl %al,%eax
c0101448:	83 e8 30             	sub    $0x30,%eax
c010144b:	83 f8 03             	cmp    $0x3,%eax
c010144e:	0f 87 30 01 00 00    	ja     c0101584 <mon_watchpoint+0x207>
                case '0' ... '3': regnum = argv[i][2] - '0'; break;
c0101454:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101457:	c1 e0 02             	shl    $0x2,%eax
c010145a:	03 45 0c             	add    0xc(%ebp),%eax
c010145d:	8b 00                	mov    (%eax),%eax
c010145f:	83 c0 02             	add    $0x2,%eax
c0101462:	0f b6 00             	movzbl (%eax),%eax
c0101465:	0f be c0             	movsbl %al,%eax
c0101468:	83 e8 30             	sub    $0x30,%eax
c010146b:	89 45 e0             	mov    %eax,-0x20(%ebp)
                default: goto bad_argv;
                }
                break;
c010146e:	e9 a7 00 00 00       	jmp    c010151a <mon_watchpoint+0x19d>
            case 't':
                switch (argv[i][2]) {
c0101473:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101476:	c1 e0 02             	shl    $0x2,%eax
c0101479:	03 45 0c             	add    0xc(%ebp),%eax
c010147c:	8b 00                	mov    (%eax),%eax
c010147e:	83 c0 02             	add    $0x2,%eax
c0101481:	0f b6 00             	movzbl (%eax),%eax
c0101484:	0f be c0             	movsbl %al,%eax
c0101487:	83 f8 61             	cmp    $0x61,%eax
c010148a:	74 12                	je     c010149e <mon_watchpoint+0x121>
c010148c:	83 f8 77             	cmp    $0x77,%eax
c010148f:	0f 85 f2 00 00 00    	jne    c0101587 <mon_watchpoint+0x20a>
                case 'w': type = 1; break;
c0101495:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
c010149c:	eb 08                	jmp    c01014a6 <mon_watchpoint+0x129>
                case 'a': type = 3; break;
c010149e:	c7 45 e4 03 00 00 00 	movl   $0x3,-0x1c(%ebp)
c01014a5:	90                   	nop
                default: goto bad_argv;
                }
                break;
c01014a6:	eb 72                	jmp    c010151a <mon_watchpoint+0x19d>
            case 'l':
                switch (argv[i][2]) {
c01014a8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01014ab:	c1 e0 02             	shl    $0x2,%eax
c01014ae:	03 45 0c             	add    0xc(%ebp),%eax
c01014b1:	8b 00                	mov    (%eax),%eax
c01014b3:	83 c0 02             	add    $0x2,%eax
c01014b6:	0f b6 00             	movzbl (%eax),%eax
c01014b9:	0f be c0             	movsbl %al,%eax
c01014bc:	83 f8 32             	cmp    $0x32,%eax
c01014bf:	74 17                	je     c01014d8 <mon_watchpoint+0x15b>
c01014c1:	83 f8 34             	cmp    $0x34,%eax
c01014c4:	74 1b                	je     c01014e1 <mon_watchpoint+0x164>
c01014c6:	83 f8 31             	cmp    $0x31,%eax
c01014c9:	0f 85 bb 00 00 00    	jne    c010158a <mon_watchpoint+0x20d>
                case '1': len = 0; break;
c01014cf:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c01014d6:	eb 42                	jmp    c010151a <mon_watchpoint+0x19d>
                case '2': len = 1; break;
c01014d8:	c7 45 e8 01 00 00 00 	movl   $0x1,-0x18(%ebp)
c01014df:	eb 39                	jmp    c010151a <mon_watchpoint+0x19d>
                case '4': len = 3; break;
c01014e1:	c7 45 e8 03 00 00 00 	movl   $0x3,-0x18(%ebp)
c01014e8:	90                   	nop
c01014e9:	eb 2f                	jmp    c010151a <mon_watchpoint+0x19d>
                break;
            }
        }
        else {
            char *endptr;
            addr = strtol(argv[i], &endptr, 16);
c01014eb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01014ee:	c1 e0 02             	shl    $0x2,%eax
c01014f1:	03 45 0c             	add    0xc(%ebp),%eax
c01014f4:	8b 00                	mov    (%eax),%eax
c01014f6:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c01014fd:	00 
c01014fe:	8d 55 d8             	lea    -0x28(%ebp),%edx
c0101501:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101505:	89 04 24             	mov    %eax,(%esp)
c0101508:	e8 d1 47 00 00       	call   c0105cde <strtol>
c010150d:	89 45 dc             	mov    %eax,-0x24(%ebp)
            if (*endptr != '\0') {
c0101510:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0101513:	0f b6 00             	movzbl (%eax),%eax
c0101516:	84 c0                	test   %al,%al
c0101518:	75 73                	jne    c010158d <mon_watchpoint+0x210>
        return 0;
    }
    uintptr_t addr;
    unsigned regnum = MAX_DR_NUM, type = 1, len = 3;
    int i;
    for (i = 0; i < argc; i ++) {
c010151a:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c010151e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101521:	3b 45 08             	cmp    0x8(%ebp),%eax
c0101524:	0f 8c 96 fe ff ff    	jl     c01013c0 <mon_watchpoint+0x43>
            if (*endptr != '\0') {
                goto bad_argv;
            }
        }
    }
    int ret = debug_enable_dr(regnum, addr, type, len);
c010152a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010152d:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0101531:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101534:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101538:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010153b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010153f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0101542:	89 04 24             	mov    %eax,(%esp)
c0101545:	e8 7c f6 ff ff       	call   c0100bc6 <debug_enable_dr>
c010154a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cprintf("set watchpoint [%d] at 0x%08x: %s.\n", regnum, addr,
c010154d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0101551:	75 07                	jne    c010155a <mon_watchpoint+0x1dd>
c0101553:	b8 e3 66 10 c0       	mov    $0xc01066e3,%eax
c0101558:	eb 05                	jmp    c010155f <mon_watchpoint+0x1e2>
c010155a:	b8 ed 66 10 c0       	mov    $0xc01066ed,%eax
c010155f:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0101563:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0101566:	89 44 24 08          	mov    %eax,0x8(%esp)
c010156a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010156d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101571:	c7 04 24 58 67 10 c0 	movl   $0xc0106758,(%esp)
c0101578:	e8 2f ec ff ff       	call   c01001ac <cprintf>
            (ret == 0) ? "successed" : "failed");
    return 0;
c010157d:	b8 00 00 00 00       	mov    $0x0,%eax
c0101582:	eb 31                	jmp    c01015b5 <mon_watchpoint+0x238>
            }
            switch (c) {
            case 'r':
                switch (argv[i][2]) {
                case '0' ... '3': regnum = argv[i][2] - '0'; break;
                default: goto bad_argv;
c0101584:	90                   	nop
c0101585:	eb 07                	jmp    c010158e <mon_watchpoint+0x211>
                break;
            case 't':
                switch (argv[i][2]) {
                case 'w': type = 1; break;
                case 'a': type = 3; break;
                default: goto bad_argv;
c0101587:	90                   	nop
c0101588:	eb 04                	jmp    c010158e <mon_watchpoint+0x211>
            case 'l':
                switch (argv[i][2]) {
                case '1': len = 0; break;
                case '2': len = 1; break;
                case '4': len = 3; break;
                default: goto bad_argv;
c010158a:	90                   	nop
c010158b:	eb 01                	jmp    c010158e <mon_watchpoint+0x211>
        }
        else {
            char *endptr;
            addr = strtol(argv[i], &endptr, 16);
            if (*endptr != '\0') {
                goto bad_argv;
c010158d:	90                   	nop
    cprintf("set watchpoint [%d] at 0x%08x: %s.\n", regnum, addr,
            (ret == 0) ? "successed" : "failed");
    return 0;

bad_argv:
    cprintf("unknow parameter(s): [%d] %s\n", i, argv[i]);
c010158e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101591:	c1 e0 02             	shl    $0x2,%eax
c0101594:	03 45 0c             	add    0xc(%ebp),%eax
c0101597:	8b 00                	mov    (%eax),%eax
c0101599:	89 44 24 08          	mov    %eax,0x8(%esp)
c010159d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01015a0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01015a4:	c7 04 24 18 67 10 c0 	movl   $0xc0106718,(%esp)
c01015ab:	e8 fc eb ff ff       	call   c01001ac <cprintf>
    return 0;
c01015b0:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01015b5:	c9                   	leave  
c01015b6:	c3                   	ret    

c01015b7 <mon_delete_dr>:

/* mon_delete_dr - delete a breakpoint or watchpoint */
int
mon_delete_dr(int argc, char **argv, struct trapframe *tf) {
c01015b7:	55                   	push   %ebp
c01015b8:	89 e5                	mov    %esp,%ebp
c01015ba:	83 ec 28             	sub    $0x28,%esp
    if (argc != 1) {
c01015bd:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c01015c1:	74 16                	je     c01015d9 <mon_delete_dr+0x22>
        cprintf("needs 1 parameter(s).\n");
c01015c3:	c7 04 24 7c 67 10 c0 	movl   $0xc010677c,(%esp)
c01015ca:	e8 dd eb ff ff       	call   c01001ac <cprintf>
        return 0;
c01015cf:	b8 00 00 00 00       	mov    $0x0,%eax
c01015d4:	e9 a1 00 00 00       	jmp    c010167a <mon_delete_dr+0xc3>
    }
    unsigned regnum = MAX_DR_NUM;
c01015d9:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
    if (strlen(argv[0]) != 1) {
c01015e0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01015e3:	8b 00                	mov    (%eax),%eax
c01015e5:	89 04 24             	mov    %eax,(%esp)
c01015e8:	e8 17 45 00 00       	call   c0105b04 <strlen>
c01015ed:	83 f8 01             	cmp    $0x1,%eax
c01015f0:	75 62                	jne    c0101654 <mon_delete_dr+0x9d>
        goto bad_argv;
    }
    else {
        switch (argv[0][0]) {
c01015f2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01015f5:	8b 00                	mov    (%eax),%eax
c01015f7:	0f b6 00             	movzbl (%eax),%eax
c01015fa:	0f be c0             	movsbl %al,%eax
c01015fd:	83 e8 30             	sub    $0x30,%eax
c0101600:	83 f8 03             	cmp    $0x3,%eax
c0101603:	77 52                	ja     c0101657 <mon_delete_dr+0xa0>
        case '0' ... '3': regnum = argv[0][0] - '0'; break;
c0101605:	8b 45 0c             	mov    0xc(%ebp),%eax
c0101608:	8b 00                	mov    (%eax),%eax
c010160a:	0f b6 00             	movzbl (%eax),%eax
c010160d:	0f be c0             	movsbl %al,%eax
c0101610:	83 e8 30             	sub    $0x30,%eax
c0101613:	89 45 f0             	mov    %eax,-0x10(%ebp)
        default: goto bad_argv;
        }
    }
    int ret = debug_disable_dr(regnum);
c0101616:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101619:	89 04 24             	mov    %eax,(%esp)
c010161c:	e8 6e f6 ff ff       	call   c0100c8f <debug_disable_dr>
c0101621:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("delete [%d]: %s.\n", regnum,
c0101624:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101628:	75 07                	jne    c0101631 <mon_delete_dr+0x7a>
c010162a:	b8 e3 66 10 c0       	mov    $0xc01066e3,%eax
c010162f:	eb 05                	jmp    c0101636 <mon_delete_dr+0x7f>
c0101631:	b8 ed 66 10 c0       	mov    $0xc01066ed,%eax
c0101636:	89 44 24 08          	mov    %eax,0x8(%esp)
c010163a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010163d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101641:	c7 04 24 93 67 10 c0 	movl   $0xc0106793,(%esp)
c0101648:	e8 5f eb ff ff       	call   c01001ac <cprintf>
            (ret == 0) ? "successed" : "failed");
    return 0;
c010164d:	b8 00 00 00 00       	mov    $0x0,%eax
c0101652:	eb 26                	jmp    c010167a <mon_delete_dr+0xc3>
        cprintf("needs 1 parameter(s).\n");
        return 0;
    }
    unsigned regnum = MAX_DR_NUM;
    if (strlen(argv[0]) != 1) {
        goto bad_argv;
c0101654:	90                   	nop
c0101655:	eb 01                	jmp    c0101658 <mon_delete_dr+0xa1>
    }
    else {
        switch (argv[0][0]) {
        case '0' ... '3': regnum = argv[0][0] - '0'; break;
        default: goto bad_argv;
c0101657:	90                   	nop
    cprintf("delete [%d]: %s.\n", regnum,
            (ret == 0) ? "successed" : "failed");
    return 0;

bad_argv:
    cprintf("unknow parameter(s): [%d] %s\n", 0, argv[0]);
c0101658:	8b 45 0c             	mov    0xc(%ebp),%eax
c010165b:	8b 00                	mov    (%eax),%eax
c010165d:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101661:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0101668:	00 
c0101669:	c7 04 24 18 67 10 c0 	movl   $0xc0106718,(%esp)
c0101670:	e8 37 eb ff ff       	call   c01001ac <cprintf>
    return 0;
c0101675:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010167a:	c9                   	leave  
c010167b:	c3                   	ret    

c010167c <mon_list_dr>:

/* mon_list_dr - list all debug registers */
int
mon_list_dr(int argc, char **argv, struct trapframe *tf) {
c010167c:	55                   	push   %ebp
c010167d:	89 e5                	mov    %esp,%ebp
c010167f:	83 ec 08             	sub    $0x8,%esp
    debug_list_dr();
c0101682:	e8 ca f6 ff ff       	call   c0100d51 <debug_list_dr>
    return 0;
c0101687:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010168c:	c9                   	leave  
c010168d:	c3                   	ret    
	...

c0101690 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0101690:	55                   	push   %ebp
c0101691:	89 e5                	mov    %esp,%ebp
c0101693:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
c0101696:	a1 cc 9e 11 c0       	mov    0xc0119ecc,%eax
c010169b:	85 c0                	test   %eax,%eax
c010169d:	75 4a                	jne    c01016e9 <__panic+0x59>
        goto panic_dead;
    }
    is_panic = 1;
c010169f:	c7 05 cc 9e 11 c0 01 	movl   $0x1,0xc0119ecc
c01016a6:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
c01016a9:	8d 45 14             	lea    0x14(%ebp),%eax
c01016ac:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
c01016af:	8b 45 0c             	mov    0xc(%ebp),%eax
c01016b2:	89 44 24 08          	mov    %eax,0x8(%esp)
c01016b6:	8b 45 08             	mov    0x8(%ebp),%eax
c01016b9:	89 44 24 04          	mov    %eax,0x4(%esp)
c01016bd:	c7 04 24 a5 67 10 c0 	movl   $0xc01067a5,(%esp)
c01016c4:	e8 e3 ea ff ff       	call   c01001ac <cprintf>
    vcprintf(fmt, ap);
c01016c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01016cc:	89 44 24 04          	mov    %eax,0x4(%esp)
c01016d0:	8b 45 10             	mov    0x10(%ebp),%eax
c01016d3:	89 04 24             	mov    %eax,(%esp)
c01016d6:	e8 9d ea ff ff       	call   c0100178 <vcprintf>
    cprintf("\n");
c01016db:	c7 04 24 c1 67 10 c0 	movl   $0xc01067c1,(%esp)
c01016e2:	e8 c5 ea ff ff       	call   c01001ac <cprintf>
c01016e7:	eb 01                	jmp    c01016ea <__panic+0x5a>
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
    if (is_panic) {
        goto panic_dead;
c01016e9:	90                   	nop
    vcprintf(fmt, ap);
    cprintf("\n");
    va_end(ap);

panic_dead:
    intr_disable();
c01016ea:	e8 93 09 00 00       	call   c0102082 <intr_disable>
    while (1) {
        monitor(NULL);
c01016ef:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01016f6:	e8 82 f9 ff ff       	call   c010107d <monitor>
    }
c01016fb:	eb f2                	jmp    c01016ef <__panic+0x5f>

c01016fd <__warn>:
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c01016fd:	55                   	push   %ebp
c01016fe:	89 e5                	mov    %esp,%ebp
c0101700:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
c0101703:	8d 45 14             	lea    0x14(%ebp),%eax
c0101706:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
c0101709:	8b 45 0c             	mov    0xc(%ebp),%eax
c010170c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101710:	8b 45 08             	mov    0x8(%ebp),%eax
c0101713:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101717:	c7 04 24 c3 67 10 c0 	movl   $0xc01067c3,(%esp)
c010171e:	e8 89 ea ff ff       	call   c01001ac <cprintf>
    vcprintf(fmt, ap);
c0101723:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101726:	89 44 24 04          	mov    %eax,0x4(%esp)
c010172a:	8b 45 10             	mov    0x10(%ebp),%eax
c010172d:	89 04 24             	mov    %eax,(%esp)
c0101730:	e8 43 ea ff ff       	call   c0100178 <vcprintf>
    cprintf("\n");
c0101735:	c7 04 24 c1 67 10 c0 	movl   $0xc01067c1,(%esp)
c010173c:	e8 6b ea ff ff       	call   c01001ac <cprintf>
    va_end(ap);
}
c0101741:	c9                   	leave  
c0101742:	c3                   	ret    

c0101743 <is_kernel_panic>:

bool
is_kernel_panic(void) {
c0101743:	55                   	push   %ebp
c0101744:	89 e5                	mov    %esp,%ebp
    return is_panic;
c0101746:	a1 cc 9e 11 c0       	mov    0xc0119ecc,%eax
}
c010174b:	5d                   	pop    %ebp
c010174c:	c3                   	ret    
c010174d:	00 00                	add    %al,(%eax)
	...

c0101750 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c0101750:	55                   	push   %ebp
c0101751:	89 e5                	mov    %esp,%ebp
c0101753:	83 ec 28             	sub    $0x28,%esp
c0101756:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
c010175c:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101760:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101764:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101768:	ee                   	out    %al,(%dx)
c0101769:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c010176f:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
c0101773:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101777:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010177b:	ee                   	out    %al,(%dx)
c010177c:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
c0101782:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
c0101786:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c010178a:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c010178e:	ee                   	out    %al,(%dx)
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
c010178f:	c7 05 cc a9 11 c0 00 	movl   $0x0,0xc011a9cc
c0101796:	00 00 00 

    cprintf("++ setup timer interrupts\n");
c0101799:	c7 04 24 e1 67 10 c0 	movl   $0xc01067e1,(%esp)
c01017a0:	e8 07 ea ff ff       	call   c01001ac <cprintf>
    pic_enable(IRQ_TIMER);
c01017a5:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01017ac:	e8 2f 09 00 00       	call   c01020e0 <pic_enable>
}
c01017b1:	c9                   	leave  
c01017b2:	c3                   	ret    
	...

c01017b4 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c01017b4:	55                   	push   %ebp
c01017b5:	89 e5                	mov    %esp,%ebp
c01017b7:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c01017ba:	9c                   	pushf  
c01017bb:	58                   	pop    %eax
c01017bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c01017bf:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c01017c2:	25 00 02 00 00       	and    $0x200,%eax
c01017c7:	85 c0                	test   %eax,%eax
c01017c9:	74 0c                	je     c01017d7 <__intr_save+0x23>
        intr_disable();
c01017cb:	e8 b2 08 00 00       	call   c0102082 <intr_disable>
        return 1;
c01017d0:	b8 01 00 00 00       	mov    $0x1,%eax
c01017d5:	eb 05                	jmp    c01017dc <__intr_save+0x28>
    }
    return 0;
c01017d7:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01017dc:	c9                   	leave  
c01017dd:	c3                   	ret    

c01017de <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c01017de:	55                   	push   %ebp
c01017df:	89 e5                	mov    %esp,%ebp
c01017e1:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c01017e4:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01017e8:	74 05                	je     c01017ef <__intr_restore+0x11>
        intr_enable();
c01017ea:	e8 8d 08 00 00       	call   c010207c <intr_enable>
    }
}
c01017ef:	c9                   	leave  
c01017f0:	c3                   	ret    

c01017f1 <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c01017f1:	55                   	push   %ebp
c01017f2:	89 e5                	mov    %esp,%ebp
c01017f4:	83 ec 10             	sub    $0x10,%esp
c01017f7:	66 c7 45 f0 84 00    	movw   $0x84,-0x10(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01017fd:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c0101801:	89 c2                	mov    %eax,%edx
c0101803:	ec                   	in     (%dx),%al
c0101804:	88 45 f3             	mov    %al,-0xd(%ebp)
    return data;
c0101807:	66 c7 45 f4 84 00    	movw   $0x84,-0xc(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c010180d:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c0101811:	89 c2                	mov    %eax,%edx
c0101813:	ec                   	in     (%dx),%al
c0101814:	88 45 f7             	mov    %al,-0x9(%ebp)
    return data;
c0101817:	66 c7 45 f8 84 00    	movw   $0x84,-0x8(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c010181d:	0f b7 45 f8          	movzwl -0x8(%ebp),%eax
c0101821:	89 c2                	mov    %eax,%edx
c0101823:	ec                   	in     (%dx),%al
c0101824:	88 45 fb             	mov    %al,-0x5(%ebp)
    return data;
c0101827:	66 c7 45 fc 84 00    	movw   $0x84,-0x4(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c010182d:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c0101831:	89 c2                	mov    %eax,%edx
c0101833:	ec                   	in     (%dx),%al
c0101834:	88 45 ff             	mov    %al,-0x1(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
c0101837:	c9                   	leave  
c0101838:	c3                   	ret    

c0101839 <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c0101839:	55                   	push   %ebp
c010183a:	89 e5                	mov    %esp,%ebp
c010183c:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c010183f:	c7 45 e4 00 80 0b c0 	movl   $0xc00b8000,-0x1c(%ebp)
    uint16_t was = *cp;
c0101846:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101849:	0f b7 00             	movzwl (%eax),%eax
c010184c:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    *cp = (uint16_t) 0xA55A;
c0101850:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101853:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
c0101858:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010185b:	0f b7 00             	movzwl (%eax),%eax
c010185e:	66 3d 5a a5          	cmp    $0xa55a,%ax
c0101862:	74 12                	je     c0101876 <cga_init+0x3d>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0101864:	c7 45 e4 00 00 0b c0 	movl   $0xc00b0000,-0x1c(%ebp)
        addr_6845 = MONO_BASE;
c010186b:	66 c7 05 e6 9e 11 c0 	movw   $0x3b4,0xc0119ee6
c0101872:	b4 03 
c0101874:	eb 13                	jmp    c0101889 <cga_init+0x50>
    } else {
        *cp = was;
c0101876:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0101879:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010187d:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
c0101880:	66 c7 05 e6 9e 11 c0 	movw   $0x3d4,0xc0119ee6
c0101887:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
c0101889:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c0101890:	0f b7 c0             	movzwl %ax,%eax
c0101893:	66 89 45 f4          	mov    %ax,-0xc(%ebp)
c0101897:	c6 45 f3 0e          	movb   $0xe,-0xd(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c010189b:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010189f:	0f b7 55 f4          	movzwl -0xc(%ebp),%edx
c01018a3:	ee                   	out    %al,(%dx)
    pos = inb(addr_6845 + 1) << 8;
c01018a4:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c01018ab:	83 c0 01             	add    $0x1,%eax
c01018ae:	0f b7 c0             	movzwl %ax,%eax
c01018b1:	66 89 45 f6          	mov    %ax,-0xa(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01018b5:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01018b9:	89 c2                	mov    %eax,%edx
c01018bb:	ec                   	in     (%dx),%al
c01018bc:	88 45 f8             	mov    %al,-0x8(%ebp)
    return data;
c01018bf:	0f b6 45 f8          	movzbl -0x8(%ebp),%eax
c01018c3:	0f b6 c0             	movzbl %al,%eax
c01018c6:	c1 e0 08             	shl    $0x8,%eax
c01018c9:	89 45 ec             	mov    %eax,-0x14(%ebp)
    outb(addr_6845, 15);
c01018cc:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c01018d3:	0f b7 c0             	movzwl %ax,%eax
c01018d6:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
c01018da:	c6 45 f9 0f          	movb   $0xf,-0x7(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c01018de:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01018e2:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01018e6:	ee                   	out    %al,(%dx)
    pos |= inb(addr_6845 + 1);
c01018e7:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c01018ee:	83 c0 01             	add    $0x1,%eax
c01018f1:	0f b7 c0             	movzwl %ax,%eax
c01018f4:	66 89 45 fc          	mov    %ax,-0x4(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01018f8:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c01018fc:	89 c2                	mov    %eax,%edx
c01018fe:	ec                   	in     (%dx),%al
c01018ff:	88 45 ff             	mov    %al,-0x1(%ebp)
    return data;
c0101902:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax
c0101906:	0f b6 c0             	movzbl %al,%eax
c0101909:	09 45 ec             	or     %eax,-0x14(%ebp)

    crt_buf = (uint16_t*) cp;
c010190c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010190f:	a3 e0 9e 11 c0       	mov    %eax,0xc0119ee0
    crt_pos = pos;
c0101914:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101917:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
}
c010191d:	c9                   	leave  
c010191e:	c3                   	ret    

c010191f <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c010191f:	55                   	push   %ebp
c0101920:	89 e5                	mov    %esp,%ebp
c0101922:	83 ec 48             	sub    $0x48,%esp
c0101925:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
c010192b:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c010192f:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0101933:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0101937:	ee                   	out    %al,(%dx)
c0101938:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
c010193e:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
c0101942:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101946:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c010194a:	ee                   	out    %al,(%dx)
c010194b:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
c0101951:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
c0101955:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0101959:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c010195d:	ee                   	out    %al,(%dx)
c010195e:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0101964:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
c0101968:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c010196c:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0101970:	ee                   	out    %al,(%dx)
c0101971:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
c0101977:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
c010197b:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c010197f:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0101983:	ee                   	out    %al,(%dx)
c0101984:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
c010198a:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
c010198e:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101992:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101996:	ee                   	out    %al,(%dx)
c0101997:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c010199d:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
c01019a1:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01019a5:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01019a9:	ee                   	out    %al,(%dx)
c01019aa:	66 c7 45 ec fd 03    	movw   $0x3fd,-0x14(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01019b0:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01019b4:	89 c2                	mov    %eax,%edx
c01019b6:	ec                   	in     (%dx),%al
c01019b7:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
c01019ba:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c01019be:	3c ff                	cmp    $0xff,%al
c01019c0:	0f 95 c0             	setne  %al
c01019c3:	0f b6 c0             	movzbl %al,%eax
c01019c6:	a3 e8 9e 11 c0       	mov    %eax,0xc0119ee8
c01019cb:	66 c7 45 f0 fa 03    	movw   $0x3fa,-0x10(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01019d1:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c01019d5:	89 c2                	mov    %eax,%edx
c01019d7:	ec                   	in     (%dx),%al
c01019d8:	88 45 f3             	mov    %al,-0xd(%ebp)
    return data;
c01019db:	66 c7 45 f4 f8 03    	movw   $0x3f8,-0xc(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c01019e1:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c01019e5:	89 c2                	mov    %eax,%edx
c01019e7:	ec                   	in     (%dx),%al
c01019e8:	88 45 f7             	mov    %al,-0x9(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
c01019eb:	a1 e8 9e 11 c0       	mov    0xc0119ee8,%eax
c01019f0:	85 c0                	test   %eax,%eax
c01019f2:	74 0c                	je     c0101a00 <serial_init+0xe1>
        pic_enable(IRQ_COM1);
c01019f4:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c01019fb:	e8 e0 06 00 00       	call   c01020e0 <pic_enable>
    }
}
c0101a00:	c9                   	leave  
c0101a01:	c3                   	ret    

c0101a02 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c0101a02:	55                   	push   %ebp
c0101a03:	89 e5                	mov    %esp,%ebp
c0101a05:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c0101a08:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0101a0f:	eb 09                	jmp    c0101a1a <lpt_putc_sub+0x18>
        delay();
c0101a11:	e8 db fd ff ff       	call   c01017f1 <delay>
}

static void
lpt_putc_sub(int c) {
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c0101a16:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
c0101a1a:	66 c7 45 f2 79 03    	movw   $0x379,-0xe(%ebp)
c0101a20:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101a24:	89 c2                	mov    %eax,%edx
c0101a26:	ec                   	in     (%dx),%al
c0101a27:	88 45 f4             	mov    %al,-0xc(%ebp)
    return data;
c0101a2a:	0f b6 45 f4          	movzbl -0xc(%ebp),%eax
c0101a2e:	84 c0                	test   %al,%al
c0101a30:	78 09                	js     c0101a3b <lpt_putc_sub+0x39>
c0101a32:	81 7d ec ff 31 00 00 	cmpl   $0x31ff,-0x14(%ebp)
c0101a39:	7e d6                	jle    c0101a11 <lpt_putc_sub+0xf>
        delay();
    }
    outb(LPTPORT + 0, c);
c0101a3b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a3e:	0f b6 c0             	movzbl %al,%eax
c0101a41:	66 c7 45 f6 78 03    	movw   $0x378,-0xa(%ebp)
c0101a47:	88 45 f5             	mov    %al,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101a4a:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101a4e:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101a52:	ee                   	out    %al,(%dx)
c0101a53:	66 c7 45 fa 7a 03    	movw   $0x37a,-0x6(%ebp)
c0101a59:	c6 45 f9 0d          	movb   $0xd,-0x7(%ebp)
c0101a5d:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101a61:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0101a65:	ee                   	out    %al,(%dx)
c0101a66:	66 c7 45 fe 7a 03    	movw   $0x37a,-0x2(%ebp)
c0101a6c:	c6 45 fd 08          	movb   $0x8,-0x3(%ebp)
c0101a70:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0101a74:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c0101a78:	ee                   	out    %al,(%dx)
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
c0101a79:	c9                   	leave  
c0101a7a:	c3                   	ret    

c0101a7b <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c0101a7b:	55                   	push   %ebp
c0101a7c:	89 e5                	mov    %esp,%ebp
c0101a7e:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c0101a81:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101a85:	74 0d                	je     c0101a94 <lpt_putc+0x19>
        lpt_putc_sub(c);
c0101a87:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a8a:	89 04 24             	mov    %eax,(%esp)
c0101a8d:	e8 70 ff ff ff       	call   c0101a02 <lpt_putc_sub>
c0101a92:	eb 24                	jmp    c0101ab8 <lpt_putc+0x3d>
    }
    else {
        lpt_putc_sub('\b');
c0101a94:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101a9b:	e8 62 ff ff ff       	call   c0101a02 <lpt_putc_sub>
        lpt_putc_sub(' ');
c0101aa0:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101aa7:	e8 56 ff ff ff       	call   c0101a02 <lpt_putc_sub>
        lpt_putc_sub('\b');
c0101aac:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101ab3:	e8 4a ff ff ff       	call   c0101a02 <lpt_putc_sub>
    }
}
c0101ab8:	c9                   	leave  
c0101ab9:	c3                   	ret    

c0101aba <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c0101aba:	55                   	push   %ebp
c0101abb:	89 e5                	mov    %esp,%ebp
c0101abd:	53                   	push   %ebx
c0101abe:	83 ec 34             	sub    $0x34,%esp
    // set black on white
    if (!(c & ~0xFF)) {
c0101ac1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ac4:	b0 00                	mov    $0x0,%al
c0101ac6:	85 c0                	test   %eax,%eax
c0101ac8:	75 07                	jne    c0101ad1 <cga_putc+0x17>
        c |= 0x0700;
c0101aca:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
c0101ad1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ad4:	25 ff 00 00 00       	and    $0xff,%eax
c0101ad9:	83 f8 0a             	cmp    $0xa,%eax
c0101adc:	74 4f                	je     c0101b2d <cga_putc+0x73>
c0101ade:	83 f8 0d             	cmp    $0xd,%eax
c0101ae1:	74 5a                	je     c0101b3d <cga_putc+0x83>
c0101ae3:	83 f8 08             	cmp    $0x8,%eax
c0101ae6:	0f 85 8d 00 00 00    	jne    c0101b79 <cga_putc+0xbf>
    case '\b':
        if (crt_pos > 0) {
c0101aec:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101af3:	66 85 c0             	test   %ax,%ax
c0101af6:	0f 84 a3 00 00 00    	je     c0101b9f <cga_putc+0xe5>
            crt_pos --;
c0101afc:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101b03:	83 e8 01             	sub    $0x1,%eax
c0101b06:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
c0101b0c:	a1 e0 9e 11 c0       	mov    0xc0119ee0,%eax
c0101b11:	0f b7 15 e4 9e 11 c0 	movzwl 0xc0119ee4,%edx
c0101b18:	0f b7 d2             	movzwl %dx,%edx
c0101b1b:	01 d2                	add    %edx,%edx
c0101b1d:	8d 14 10             	lea    (%eax,%edx,1),%edx
c0101b20:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b23:	b0 00                	mov    $0x0,%al
c0101b25:	83 c8 20             	or     $0x20,%eax
c0101b28:	66 89 02             	mov    %ax,(%edx)
        }
        break;
c0101b2b:	eb 73                	jmp    c0101ba0 <cga_putc+0xe6>
    case '\n':
        crt_pos += CRT_COLS;
c0101b2d:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101b34:	83 c0 50             	add    $0x50,%eax
c0101b37:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
c0101b3d:	0f b7 1d e4 9e 11 c0 	movzwl 0xc0119ee4,%ebx
c0101b44:	0f b7 0d e4 9e 11 c0 	movzwl 0xc0119ee4,%ecx
c0101b4b:	0f b7 c1             	movzwl %cx,%eax
c0101b4e:	69 c0 cd cc 00 00    	imul   $0xcccd,%eax,%eax
c0101b54:	c1 e8 10             	shr    $0x10,%eax
c0101b57:	89 c2                	mov    %eax,%edx
c0101b59:	66 c1 ea 06          	shr    $0x6,%dx
c0101b5d:	89 d0                	mov    %edx,%eax
c0101b5f:	c1 e0 02             	shl    $0x2,%eax
c0101b62:	01 d0                	add    %edx,%eax
c0101b64:	c1 e0 04             	shl    $0x4,%eax
c0101b67:	89 ca                	mov    %ecx,%edx
c0101b69:	66 29 c2             	sub    %ax,%dx
c0101b6c:	89 d8                	mov    %ebx,%eax
c0101b6e:	66 29 d0             	sub    %dx,%ax
c0101b71:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
        break;
c0101b77:	eb 27                	jmp    c0101ba0 <cga_putc+0xe6>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
c0101b79:	8b 15 e0 9e 11 c0    	mov    0xc0119ee0,%edx
c0101b7f:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101b86:	0f b7 c8             	movzwl %ax,%ecx
c0101b89:	01 c9                	add    %ecx,%ecx
c0101b8b:	8d 0c 0a             	lea    (%edx,%ecx,1),%ecx
c0101b8e:	8b 55 08             	mov    0x8(%ebp),%edx
c0101b91:	66 89 11             	mov    %dx,(%ecx)
c0101b94:	83 c0 01             	add    $0x1,%eax
c0101b97:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
c0101b9d:	eb 01                	jmp    c0101ba0 <cga_putc+0xe6>
    case '\b':
        if (crt_pos > 0) {
            crt_pos --;
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
        }
        break;
c0101b9f:	90                   	nop
        crt_buf[crt_pos ++] = c;     // write the character
        break;
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
c0101ba0:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101ba7:	66 3d cf 07          	cmp    $0x7cf,%ax
c0101bab:	76 5b                	jbe    c0101c08 <cga_putc+0x14e>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c0101bad:	a1 e0 9e 11 c0       	mov    0xc0119ee0,%eax
c0101bb2:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c0101bb8:	a1 e0 9e 11 c0       	mov    0xc0119ee0,%eax
c0101bbd:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
c0101bc4:	00 
c0101bc5:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101bc9:	89 04 24             	mov    %eax,(%esp)
c0101bcc:	e8 a5 42 00 00       	call   c0105e76 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101bd1:	c7 45 e4 80 07 00 00 	movl   $0x780,-0x1c(%ebp)
c0101bd8:	eb 15                	jmp    c0101bef <cga_putc+0x135>
            crt_buf[i] = 0x0700 | ' ';
c0101bda:	a1 e0 9e 11 c0       	mov    0xc0119ee0,%eax
c0101bdf:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0101be2:	01 d2                	add    %edx,%edx
c0101be4:	01 d0                	add    %edx,%eax
c0101be6:	66 c7 00 20 07       	movw   $0x720,(%eax)

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101beb:	83 45 e4 01          	addl   $0x1,-0x1c(%ebp)
c0101bef:	81 7d e4 cf 07 00 00 	cmpl   $0x7cf,-0x1c(%ebp)
c0101bf6:	7e e2                	jle    c0101bda <cga_putc+0x120>
            crt_buf[i] = 0x0700 | ' ';
        }
        crt_pos -= CRT_COLS;
c0101bf8:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101bff:	83 e8 50             	sub    $0x50,%eax
c0101c02:	66 a3 e4 9e 11 c0    	mov    %ax,0xc0119ee4
    }

    // move that little blinky thing
    outb(addr_6845, 14);
c0101c08:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c0101c0f:	0f b7 c0             	movzwl %ax,%eax
c0101c12:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
c0101c16:	c6 45 e9 0e          	movb   $0xe,-0x17(%ebp)
c0101c1a:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101c1e:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101c22:	ee                   	out    %al,(%dx)
    outb(addr_6845 + 1, crt_pos >> 8);
c0101c23:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101c2a:	66 c1 e8 08          	shr    $0x8,%ax
c0101c2e:	0f b6 c0             	movzbl %al,%eax
c0101c31:	0f b7 15 e6 9e 11 c0 	movzwl 0xc0119ee6,%edx
c0101c38:	83 c2 01             	add    $0x1,%edx
c0101c3b:	0f b7 d2             	movzwl %dx,%edx
c0101c3e:	66 89 55 ee          	mov    %dx,-0x12(%ebp)
c0101c42:	88 45 ed             	mov    %al,-0x13(%ebp)
c0101c45:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101c49:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101c4d:	ee                   	out    %al,(%dx)
    outb(addr_6845, 15);
c0101c4e:	0f b7 05 e6 9e 11 c0 	movzwl 0xc0119ee6,%eax
c0101c55:	0f b7 c0             	movzwl %ax,%eax
c0101c58:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
c0101c5c:	c6 45 f1 0f          	movb   $0xf,-0xf(%ebp)
c0101c60:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101c64:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101c68:	ee                   	out    %al,(%dx)
    outb(addr_6845 + 1, crt_pos);
c0101c69:	0f b7 05 e4 9e 11 c0 	movzwl 0xc0119ee4,%eax
c0101c70:	0f b6 c0             	movzbl %al,%eax
c0101c73:	0f b7 15 e6 9e 11 c0 	movzwl 0xc0119ee6,%edx
c0101c7a:	83 c2 01             	add    $0x1,%edx
c0101c7d:	0f b7 d2             	movzwl %dx,%edx
c0101c80:	66 89 55 f6          	mov    %dx,-0xa(%ebp)
c0101c84:	88 45 f5             	mov    %al,-0xb(%ebp)
c0101c87:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101c8b:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101c8f:	ee                   	out    %al,(%dx)
}
c0101c90:	83 c4 34             	add    $0x34,%esp
c0101c93:	5b                   	pop    %ebx
c0101c94:	5d                   	pop    %ebp
c0101c95:	c3                   	ret    

c0101c96 <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c0101c96:	55                   	push   %ebp
c0101c97:	89 e5                	mov    %esp,%ebp
c0101c99:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101c9c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0101ca3:	eb 09                	jmp    c0101cae <serial_putc_sub+0x18>
        delay();
c0101ca5:	e8 47 fb ff ff       	call   c01017f1 <delay>
}

static void
serial_putc_sub(int c) {
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101caa:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
c0101cae:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101cb4:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101cb8:	89 c2                	mov    %eax,%edx
c0101cba:	ec                   	in     (%dx),%al
c0101cbb:	88 45 fc             	mov    %al,-0x4(%ebp)
    return data;
c0101cbe:	0f b6 45 fc          	movzbl -0x4(%ebp),%eax
c0101cc2:	0f b6 c0             	movzbl %al,%eax
c0101cc5:	83 e0 20             	and    $0x20,%eax
c0101cc8:	85 c0                	test   %eax,%eax
c0101cca:	75 09                	jne    c0101cd5 <serial_putc_sub+0x3f>
c0101ccc:	81 7d f4 ff 31 00 00 	cmpl   $0x31ff,-0xc(%ebp)
c0101cd3:	7e d0                	jle    c0101ca5 <serial_putc_sub+0xf>
        delay();
    }
    outb(COM1 + COM_TX, c);
c0101cd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cd8:	0f b6 c0             	movzbl %al,%eax
c0101cdb:	66 c7 45 fe f8 03    	movw   $0x3f8,-0x2(%ebp)
c0101ce1:	88 45 fd             	mov    %al,-0x3(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101ce4:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0101ce8:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c0101cec:	ee                   	out    %al,(%dx)
}
c0101ced:	c9                   	leave  
c0101cee:	c3                   	ret    

c0101cef <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c0101cef:	55                   	push   %ebp
c0101cf0:	89 e5                	mov    %esp,%ebp
c0101cf2:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c0101cf5:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101cf9:	74 0d                	je     c0101d08 <serial_putc+0x19>
        serial_putc_sub(c);
c0101cfb:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cfe:	89 04 24             	mov    %eax,(%esp)
c0101d01:	e8 90 ff ff ff       	call   c0101c96 <serial_putc_sub>
c0101d06:	eb 24                	jmp    c0101d2c <serial_putc+0x3d>
    }
    else {
        serial_putc_sub('\b');
c0101d08:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101d0f:	e8 82 ff ff ff       	call   c0101c96 <serial_putc_sub>
        serial_putc_sub(' ');
c0101d14:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101d1b:	e8 76 ff ff ff       	call   c0101c96 <serial_putc_sub>
        serial_putc_sub('\b');
c0101d20:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101d27:	e8 6a ff ff ff       	call   c0101c96 <serial_putc_sub>
    }
}
c0101d2c:	c9                   	leave  
c0101d2d:	c3                   	ret    

c0101d2e <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c0101d2e:	55                   	push   %ebp
c0101d2f:	89 e5                	mov    %esp,%ebp
c0101d31:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
c0101d34:	eb 32                	jmp    c0101d68 <cons_intr+0x3a>
        if (c != 0) {
c0101d36:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0101d3a:	74 2c                	je     c0101d68 <cons_intr+0x3a>
            cons.buf[cons.wpos ++] = c;
c0101d3c:	a1 04 a1 11 c0       	mov    0xc011a104,%eax
c0101d41:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101d44:	88 90 00 9f 11 c0    	mov    %dl,-0x3fee6100(%eax)
c0101d4a:	83 c0 01             	add    $0x1,%eax
c0101d4d:	a3 04 a1 11 c0       	mov    %eax,0xc011a104
            if (cons.wpos == CONSBUFSIZE) {
c0101d52:	a1 04 a1 11 c0       	mov    0xc011a104,%eax
c0101d57:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101d5c:	75 0a                	jne    c0101d68 <cons_intr+0x3a>
                cons.wpos = 0;
c0101d5e:	c7 05 04 a1 11 c0 00 	movl   $0x0,0xc011a104
c0101d65:	00 00 00 
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
    int c;
    while ((c = (*proc)()) != -1) {
c0101d68:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d6b:	ff d0                	call   *%eax
c0101d6d:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101d70:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c0101d74:	75 c0                	jne    c0101d36 <cons_intr+0x8>
            if (cons.wpos == CONSBUFSIZE) {
                cons.wpos = 0;
            }
        }
    }
}
c0101d76:	c9                   	leave  
c0101d77:	c3                   	ret    

c0101d78 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c0101d78:	55                   	push   %ebp
c0101d79:	89 e5                	mov    %esp,%ebp
c0101d7b:	83 ec 10             	sub    $0x10,%esp
c0101d7e:	66 c7 45 f8 fd 03    	movw   $0x3fd,-0x8(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101d84:	0f b7 45 f8          	movzwl -0x8(%ebp),%eax
c0101d88:	89 c2                	mov    %eax,%edx
c0101d8a:	ec                   	in     (%dx),%al
c0101d8b:	88 45 fb             	mov    %al,-0x5(%ebp)
    return data;
c0101d8e:	0f b6 45 fb          	movzbl -0x5(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c0101d92:	0f b6 c0             	movzbl %al,%eax
c0101d95:	83 e0 01             	and    $0x1,%eax
c0101d98:	85 c0                	test   %eax,%eax
c0101d9a:	75 07                	jne    c0101da3 <serial_proc_data+0x2b>
        return -1;
c0101d9c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101da1:	eb 2a                	jmp    c0101dcd <serial_proc_data+0x55>
c0101da3:	66 c7 45 fc f8 03    	movw   $0x3f8,-0x4(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101da9:	0f b7 45 fc          	movzwl -0x4(%ebp),%eax
c0101dad:	89 c2                	mov    %eax,%edx
c0101daf:	ec                   	in     (%dx),%al
c0101db0:	88 45 ff             	mov    %al,-0x1(%ebp)
    return data;
c0101db3:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
c0101db7:	0f b6 c0             	movzbl %al,%eax
c0101dba:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (c == 127) {
c0101dbd:	83 7d f4 7f          	cmpl   $0x7f,-0xc(%ebp)
c0101dc1:	75 07                	jne    c0101dca <serial_proc_data+0x52>
        c = '\b';
c0101dc3:	c7 45 f4 08 00 00 00 	movl   $0x8,-0xc(%ebp)
    }
    return c;
c0101dca:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101dcd:	c9                   	leave  
c0101dce:	c3                   	ret    

c0101dcf <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c0101dcf:	55                   	push   %ebp
c0101dd0:	89 e5                	mov    %esp,%ebp
c0101dd2:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
c0101dd5:	a1 e8 9e 11 c0       	mov    0xc0119ee8,%eax
c0101dda:	85 c0                	test   %eax,%eax
c0101ddc:	74 0c                	je     c0101dea <serial_intr+0x1b>
        cons_intr(serial_proc_data);
c0101dde:	c7 04 24 78 1d 10 c0 	movl   $0xc0101d78,(%esp)
c0101de5:	e8 44 ff ff ff       	call   c0101d2e <cons_intr>
    }
}
c0101dea:	c9                   	leave  
c0101deb:	c3                   	ret    

c0101dec <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c0101dec:	55                   	push   %ebp
c0101ded:	89 e5                	mov    %esp,%ebp
c0101def:	83 ec 28             	sub    $0x28,%esp
c0101df2:	66 c7 45 ee 64 00    	movw   $0x64,-0x12(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101df8:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c0101dfc:	89 c2                	mov    %eax,%edx
c0101dfe:	ec                   	in     (%dx),%al
c0101dff:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
c0101e02:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
c0101e06:	0f b6 c0             	movzbl %al,%eax
c0101e09:	83 e0 01             	and    $0x1,%eax
c0101e0c:	85 c0                	test   %eax,%eax
c0101e0e:	75 0a                	jne    c0101e1a <kbd_proc_data+0x2e>
        return -1;
c0101e10:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101e15:	e9 5a 01 00 00       	jmp    c0101f74 <kbd_proc_data+0x188>
c0101e1a:	66 c7 45 f2 60 00    	movw   $0x60,-0xe(%ebp)
static inline void invlpg(void *addr) __attribute__((always_inline));

static inline uint8_t
inb(uint16_t port) {
    uint8_t data;
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
c0101e20:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0101e24:	89 c2                	mov    %eax,%edx
c0101e26:	ec                   	in     (%dx),%al
c0101e27:	88 45 f4             	mov    %al,-0xc(%ebp)
    return data;
c0101e2a:	0f b6 45 f4          	movzbl -0xc(%ebp),%eax
    }

    data = inb(KBDATAP);
c0101e2e:	88 45 ed             	mov    %al,-0x13(%ebp)

    if (data == 0xE0) {
c0101e31:	80 7d ed e0          	cmpb   $0xe0,-0x13(%ebp)
c0101e35:	75 17                	jne    c0101e4e <kbd_proc_data+0x62>
        // E0 escape character
        shift |= E0ESC;
c0101e37:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101e3c:	83 c8 40             	or     $0x40,%eax
c0101e3f:	a3 08 a1 11 c0       	mov    %eax,0xc011a108
        return 0;
c0101e44:	b8 00 00 00 00       	mov    $0x0,%eax
c0101e49:	e9 26 01 00 00       	jmp    c0101f74 <kbd_proc_data+0x188>
    } else if (data & 0x80) {
c0101e4e:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101e52:	84 c0                	test   %al,%al
c0101e54:	79 47                	jns    c0101e9d <kbd_proc_data+0xb1>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
c0101e56:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101e5b:	83 e0 40             	and    $0x40,%eax
c0101e5e:	85 c0                	test   %eax,%eax
c0101e60:	75 09                	jne    c0101e6b <kbd_proc_data+0x7f>
c0101e62:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101e66:	83 e0 7f             	and    $0x7f,%eax
c0101e69:	eb 04                	jmp    c0101e6f <kbd_proc_data+0x83>
c0101e6b:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101e6f:	88 45 ed             	mov    %al,-0x13(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
c0101e72:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101e76:	0f b6 80 c0 90 11 c0 	movzbl -0x3fee6f40(%eax),%eax
c0101e7d:	83 c8 40             	or     $0x40,%eax
c0101e80:	0f b6 c0             	movzbl %al,%eax
c0101e83:	f7 d0                	not    %eax
c0101e85:	89 c2                	mov    %eax,%edx
c0101e87:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101e8c:	21 d0                	and    %edx,%eax
c0101e8e:	a3 08 a1 11 c0       	mov    %eax,0xc011a108
        return 0;
c0101e93:	b8 00 00 00 00       	mov    $0x0,%eax
c0101e98:	e9 d7 00 00 00       	jmp    c0101f74 <kbd_proc_data+0x188>
    } else if (shift & E0ESC) {
c0101e9d:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101ea2:	83 e0 40             	and    $0x40,%eax
c0101ea5:	85 c0                	test   %eax,%eax
c0101ea7:	74 11                	je     c0101eba <kbd_proc_data+0xce>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
c0101ea9:	80 4d ed 80          	orb    $0x80,-0x13(%ebp)
        shift &= ~E0ESC;
c0101ead:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101eb2:	83 e0 bf             	and    $0xffffffbf,%eax
c0101eb5:	a3 08 a1 11 c0       	mov    %eax,0xc011a108
    }

    shift |= shiftcode[data];
c0101eba:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101ebe:	0f b6 80 c0 90 11 c0 	movzbl -0x3fee6f40(%eax),%eax
c0101ec5:	0f b6 d0             	movzbl %al,%edx
c0101ec8:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101ecd:	09 d0                	or     %edx,%eax
c0101ecf:	a3 08 a1 11 c0       	mov    %eax,0xc011a108
    shift ^= togglecode[data];
c0101ed4:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101ed8:	0f b6 80 c0 91 11 c0 	movzbl -0x3fee6e40(%eax),%eax
c0101edf:	0f b6 d0             	movzbl %al,%edx
c0101ee2:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101ee7:	31 d0                	xor    %edx,%eax
c0101ee9:	a3 08 a1 11 c0       	mov    %eax,0xc011a108

    c = charcode[shift & (CTL | SHIFT)][data];
c0101eee:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101ef3:	83 e0 03             	and    $0x3,%eax
c0101ef6:	8b 14 85 c0 95 11 c0 	mov    -0x3fee6a40(,%eax,4),%edx
c0101efd:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101f01:	8d 04 02             	lea    (%edx,%eax,1),%eax
c0101f04:	0f b6 00             	movzbl (%eax),%eax
c0101f07:	0f b6 c0             	movzbl %al,%eax
c0101f0a:	89 45 e8             	mov    %eax,-0x18(%ebp)
    if (shift & CAPSLOCK) {
c0101f0d:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101f12:	83 e0 08             	and    $0x8,%eax
c0101f15:	85 c0                	test   %eax,%eax
c0101f17:	74 22                	je     c0101f3b <kbd_proc_data+0x14f>
        if ('a' <= c && c <= 'z')
c0101f19:	83 7d e8 60          	cmpl   $0x60,-0x18(%ebp)
c0101f1d:	7e 0c                	jle    c0101f2b <kbd_proc_data+0x13f>
c0101f1f:	83 7d e8 7a          	cmpl   $0x7a,-0x18(%ebp)
c0101f23:	7f 06                	jg     c0101f2b <kbd_proc_data+0x13f>
            c += 'A' - 'a';
c0101f25:	83 6d e8 20          	subl   $0x20,-0x18(%ebp)
    shift |= shiftcode[data];
    shift ^= togglecode[data];

    c = charcode[shift & (CTL | SHIFT)][data];
    if (shift & CAPSLOCK) {
        if ('a' <= c && c <= 'z')
c0101f29:	eb 10                	jmp    c0101f3b <kbd_proc_data+0x14f>
            c += 'A' - 'a';
        else if ('A' <= c && c <= 'Z')
c0101f2b:	83 7d e8 40          	cmpl   $0x40,-0x18(%ebp)
c0101f2f:	7e 0a                	jle    c0101f3b <kbd_proc_data+0x14f>
c0101f31:	83 7d e8 5a          	cmpl   $0x5a,-0x18(%ebp)
c0101f35:	7f 04                	jg     c0101f3b <kbd_proc_data+0x14f>
            c += 'a' - 'A';
c0101f37:	83 45 e8 20          	addl   $0x20,-0x18(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c0101f3b:	a1 08 a1 11 c0       	mov    0xc011a108,%eax
c0101f40:	f7 d0                	not    %eax
c0101f42:	83 e0 06             	and    $0x6,%eax
c0101f45:	85 c0                	test   %eax,%eax
c0101f47:	75 28                	jne    c0101f71 <kbd_proc_data+0x185>
c0101f49:	81 7d e8 e9 00 00 00 	cmpl   $0xe9,-0x18(%ebp)
c0101f50:	75 1f                	jne    c0101f71 <kbd_proc_data+0x185>
        cprintf("Rebooting!\n");
c0101f52:	c7 04 24 fc 67 10 c0 	movl   $0xc01067fc,(%esp)
c0101f59:	e8 4e e2 ff ff       	call   c01001ac <cprintf>
c0101f5e:	66 c7 45 f6 92 00    	movw   $0x92,-0xa(%ebp)
c0101f64:	c6 45 f5 03          	movb   $0x3,-0xb(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c0101f68:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101f6c:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101f70:	ee                   	out    %al,(%dx)
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
c0101f71:	8b 45 e8             	mov    -0x18(%ebp),%eax
}
c0101f74:	c9                   	leave  
c0101f75:	c3                   	ret    

c0101f76 <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c0101f76:	55                   	push   %ebp
c0101f77:	89 e5                	mov    %esp,%ebp
c0101f79:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
c0101f7c:	c7 04 24 ec 1d 10 c0 	movl   $0xc0101dec,(%esp)
c0101f83:	e8 a6 fd ff ff       	call   c0101d2e <cons_intr>
}
c0101f88:	c9                   	leave  
c0101f89:	c3                   	ret    

c0101f8a <kbd_init>:

static void
kbd_init(void) {
c0101f8a:	55                   	push   %ebp
c0101f8b:	89 e5                	mov    %esp,%ebp
c0101f8d:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
c0101f90:	e8 e1 ff ff ff       	call   c0101f76 <kbd_intr>
    pic_enable(IRQ_KBD);
c0101f95:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0101f9c:	e8 3f 01 00 00       	call   c01020e0 <pic_enable>
}
c0101fa1:	c9                   	leave  
c0101fa2:	c3                   	ret    

c0101fa3 <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c0101fa3:	55                   	push   %ebp
c0101fa4:	89 e5                	mov    %esp,%ebp
c0101fa6:	83 ec 18             	sub    $0x18,%esp
    cga_init();
c0101fa9:	e8 8b f8 ff ff       	call   c0101839 <cga_init>
    serial_init();
c0101fae:	e8 6c f9 ff ff       	call   c010191f <serial_init>
    kbd_init();
c0101fb3:	e8 d2 ff ff ff       	call   c0101f8a <kbd_init>
    if (!serial_exists) {
c0101fb8:	a1 e8 9e 11 c0       	mov    0xc0119ee8,%eax
c0101fbd:	85 c0                	test   %eax,%eax
c0101fbf:	75 0c                	jne    c0101fcd <cons_init+0x2a>
        cprintf("serial port does not exist!!\n");
c0101fc1:	c7 04 24 08 68 10 c0 	movl   $0xc0106808,(%esp)
c0101fc8:	e8 df e1 ff ff       	call   c01001ac <cprintf>
    }
}
c0101fcd:	c9                   	leave  
c0101fce:	c3                   	ret    

c0101fcf <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c0101fcf:	55                   	push   %ebp
c0101fd0:	89 e5                	mov    %esp,%ebp
c0101fd2:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0101fd5:	e8 da f7 ff ff       	call   c01017b4 <__intr_save>
c0101fda:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
c0101fdd:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fe0:	89 04 24             	mov    %eax,(%esp)
c0101fe3:	e8 93 fa ff ff       	call   c0101a7b <lpt_putc>
        cga_putc(c);
c0101fe8:	8b 45 08             	mov    0x8(%ebp),%eax
c0101feb:	89 04 24             	mov    %eax,(%esp)
c0101fee:	e8 c7 fa ff ff       	call   c0101aba <cga_putc>
        serial_putc(c);
c0101ff3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ff6:	89 04 24             	mov    %eax,(%esp)
c0101ff9:	e8 f1 fc ff ff       	call   c0101cef <serial_putc>
    }
    local_intr_restore(intr_flag);
c0101ffe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102001:	89 04 24             	mov    %eax,(%esp)
c0102004:	e8 d5 f7 ff ff       	call   c01017de <__intr_restore>
}
c0102009:	c9                   	leave  
c010200a:	c3                   	ret    

c010200b <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c010200b:	55                   	push   %ebp
c010200c:	89 e5                	mov    %esp,%ebp
c010200e:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
c0102011:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0102018:	e8 97 f7 ff ff       	call   c01017b4 <__intr_save>
c010201d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
c0102020:	e8 aa fd ff ff       	call   c0101dcf <serial_intr>
        kbd_intr();
c0102025:	e8 4c ff ff ff       	call   c0101f76 <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
c010202a:	8b 15 00 a1 11 c0    	mov    0xc011a100,%edx
c0102030:	a1 04 a1 11 c0       	mov    0xc011a104,%eax
c0102035:	39 c2                	cmp    %eax,%edx
c0102037:	74 30                	je     c0102069 <cons_getc+0x5e>
            c = cons.buf[cons.rpos ++];
c0102039:	a1 00 a1 11 c0       	mov    0xc011a100,%eax
c010203e:	0f b6 90 00 9f 11 c0 	movzbl -0x3fee6100(%eax),%edx
c0102045:	0f b6 d2             	movzbl %dl,%edx
c0102048:	89 55 f0             	mov    %edx,-0x10(%ebp)
c010204b:	83 c0 01             	add    $0x1,%eax
c010204e:	a3 00 a1 11 c0       	mov    %eax,0xc011a100
            if (cons.rpos == CONSBUFSIZE) {
c0102053:	a1 00 a1 11 c0       	mov    0xc011a100,%eax
c0102058:	3d 00 02 00 00       	cmp    $0x200,%eax
c010205d:	75 0a                	jne    c0102069 <cons_getc+0x5e>
                cons.rpos = 0;
c010205f:	c7 05 00 a1 11 c0 00 	movl   $0x0,0xc011a100
c0102066:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
c0102069:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010206c:	89 04 24             	mov    %eax,(%esp)
c010206f:	e8 6a f7 ff ff       	call   c01017de <__intr_restore>
    return c;
c0102074:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0102077:	c9                   	leave  
c0102078:	c3                   	ret    
c0102079:	00 00                	add    %al,(%eax)
	...

c010207c <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c010207c:	55                   	push   %ebp
c010207d:	89 e5                	mov    %esp,%ebp
    asm volatile ("lidt (%0)" :: "r" (pd));
}

static inline void
sti(void) {
    asm volatile ("sti");
c010207f:	fb                   	sti    
    sti();
}
c0102080:	5d                   	pop    %ebp
c0102081:	c3                   	ret    

c0102082 <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c0102082:	55                   	push   %ebp
c0102083:	89 e5                	mov    %esp,%ebp
}

static inline void
cli(void) {
    asm volatile ("cli");
c0102085:	fa                   	cli    
    cli();
}
c0102086:	5d                   	pop    %ebp
c0102087:	c3                   	ret    

c0102088 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c0102088:	55                   	push   %ebp
c0102089:	89 e5                	mov    %esp,%ebp
c010208b:	83 ec 14             	sub    $0x14,%esp
c010208e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102091:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
c0102095:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c0102099:	66 a3 d0 95 11 c0    	mov    %ax,0xc01195d0
    if (did_init) {
c010209f:	a1 0c a1 11 c0       	mov    0xc011a10c,%eax
c01020a4:	85 c0                	test   %eax,%eax
c01020a6:	74 36                	je     c01020de <pic_setmask+0x56>
        outb(IO_PIC1 + 1, mask);
c01020a8:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01020ac:	0f b6 c0             	movzbl %al,%eax
c01020af:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
c01020b5:	88 45 f9             	mov    %al,-0x7(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
c01020b8:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01020bc:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01020c0:	ee                   	out    %al,(%dx)
        outb(IO_PIC2 + 1, mask >> 8);
c01020c1:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01020c5:	66 c1 e8 08          	shr    $0x8,%ax
c01020c9:	0f b6 c0             	movzbl %al,%eax
c01020cc:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
c01020d2:	88 45 fd             	mov    %al,-0x3(%ebp)
c01020d5:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c01020d9:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c01020dd:	ee                   	out    %al,(%dx)
    }
}
c01020de:	c9                   	leave  
c01020df:	c3                   	ret    

c01020e0 <pic_enable>:

void
pic_enable(unsigned int irq) {
c01020e0:	55                   	push   %ebp
c01020e1:	89 e5                	mov    %esp,%ebp
c01020e3:	53                   	push   %ebx
c01020e4:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
c01020e7:	8b 45 08             	mov    0x8(%ebp),%eax
c01020ea:	ba 01 00 00 00       	mov    $0x1,%edx
c01020ef:	89 d3                	mov    %edx,%ebx
c01020f1:	89 c1                	mov    %eax,%ecx
c01020f3:	d3 e3                	shl    %cl,%ebx
c01020f5:	89 d8                	mov    %ebx,%eax
c01020f7:	89 c2                	mov    %eax,%edx
c01020f9:	f7 d2                	not    %edx
c01020fb:	0f b7 05 d0 95 11 c0 	movzwl 0xc01195d0,%eax
c0102102:	21 d0                	and    %edx,%eax
c0102104:	0f b7 c0             	movzwl %ax,%eax
c0102107:	89 04 24             	mov    %eax,(%esp)
c010210a:	e8 79 ff ff ff       	call   c0102088 <pic_setmask>
}
c010210f:	83 c4 04             	add    $0x4,%esp
c0102112:	5b                   	pop    %ebx
c0102113:	5d                   	pop    %ebp
c0102114:	c3                   	ret    

c0102115 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c0102115:	55                   	push   %ebp
c0102116:	89 e5                	mov    %esp,%ebp
c0102118:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
c010211b:	c7 05 0c a1 11 c0 01 	movl   $0x1,0xc011a10c
c0102122:	00 00 00 
c0102125:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
c010212b:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
c010212f:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c0102133:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0102137:	ee                   	out    %al,(%dx)
c0102138:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
c010213e:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
c0102142:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c0102146:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c010214a:	ee                   	out    %al,(%dx)
c010214b:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c0102151:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
c0102155:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0102159:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c010215d:	ee                   	out    %al,(%dx)
c010215e:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
c0102164:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
c0102168:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c010216c:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0102170:	ee                   	out    %al,(%dx)
c0102171:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
c0102177:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
c010217b:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c010217f:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0102183:	ee                   	out    %al,(%dx)
c0102184:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
c010218a:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
c010218e:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c0102192:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0102196:	ee                   	out    %al,(%dx)
c0102197:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
c010219d:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
c01021a1:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01021a5:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01021a9:	ee                   	out    %al,(%dx)
c01021aa:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
c01021b0:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
c01021b4:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01021b8:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01021bc:	ee                   	out    %al,(%dx)
c01021bd:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
c01021c3:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
c01021c7:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01021cb:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01021cf:	ee                   	out    %al,(%dx)
c01021d0:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
c01021d6:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
c01021da:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c01021de:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c01021e2:	ee                   	out    %al,(%dx)
c01021e3:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
c01021e9:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
c01021ed:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01021f1:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01021f5:	ee                   	out    %al,(%dx)
c01021f6:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c01021fc:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
c0102200:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0102204:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0102208:	ee                   	out    %al,(%dx)
c0102209:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
c010220f:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
c0102213:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0102217:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c010221b:	ee                   	out    %al,(%dx)
c010221c:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
c0102222:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
c0102226:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c010222a:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c010222e:	ee                   	out    %al,(%dx)
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
c010222f:	0f b7 05 d0 95 11 c0 	movzwl 0xc01195d0,%eax
c0102236:	66 83 f8 ff          	cmp    $0xffffffff,%ax
c010223a:	74 12                	je     c010224e <pic_init+0x139>
        pic_setmask(irq_mask);
c010223c:	0f b7 05 d0 95 11 c0 	movzwl 0xc01195d0,%eax
c0102243:	0f b7 c0             	movzwl %ax,%eax
c0102246:	89 04 24             	mov    %eax,(%esp)
c0102249:	e8 3a fe ff ff       	call   c0102088 <pic_setmask>
    }
}
c010224e:	c9                   	leave  
c010224f:	c3                   	ret    

c0102250 <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
c0102250:	55                   	push   %ebp
c0102251:	89 e5                	mov    %esp,%ebp
c0102253:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
c0102256:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
c010225d:	00 
c010225e:	c7 04 24 40 68 10 c0 	movl   $0xc0106840,(%esp)
c0102265:	e8 42 df ff ff       	call   c01001ac <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
c010226a:	c7 04 24 4a 68 10 c0 	movl   $0xc010684a,(%esp)
c0102271:	e8 36 df ff ff       	call   c01001ac <cprintf>
    panic("EOT: kernel seems ok.");
c0102276:	c7 44 24 08 58 68 10 	movl   $0xc0106858,0x8(%esp)
c010227d:	c0 
c010227e:	c7 44 24 04 12 00 00 	movl   $0x12,0x4(%esp)
c0102285:	00 
c0102286:	c7 04 24 6e 68 10 c0 	movl   $0xc010686e,(%esp)
c010228d:	e8 fe f3 ff ff       	call   c0101690 <__panic>

c0102292 <idt_init>:
static struct pseudodesc idt_pd = {
    sizeof(idt) - 1, (uintptr_t)idt
};

void
idt_init(void) {
c0102292:	55                   	push   %ebp
c0102293:	89 e5                	mov    %esp,%ebp
c0102295:	83 ec 10             	sub    $0x10,%esp
    extern uintptr_t __vectors[];
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c0102298:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c010229f:	e9 bf 00 00 00       	jmp    c0102363 <idt_init+0xd1>
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
c01022a4:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022a7:	8b 55 f8             	mov    -0x8(%ebp),%edx
c01022aa:	8b 14 95 60 96 11 c0 	mov    -0x3fee69a0(,%edx,4),%edx
c01022b1:	66 89 14 c5 20 a1 11 	mov    %dx,-0x3fee5ee0(,%eax,8)
c01022b8:	c0 
c01022b9:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022bc:	66 c7 04 c5 22 a1 11 	movw   $0x8,-0x3fee5ede(,%eax,8)
c01022c3:	c0 08 00 
c01022c6:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022c9:	0f b6 14 c5 24 a1 11 	movzbl -0x3fee5edc(,%eax,8),%edx
c01022d0:	c0 
c01022d1:	83 e2 e0             	and    $0xffffffe0,%edx
c01022d4:	88 14 c5 24 a1 11 c0 	mov    %dl,-0x3fee5edc(,%eax,8)
c01022db:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022de:	0f b6 14 c5 24 a1 11 	movzbl -0x3fee5edc(,%eax,8),%edx
c01022e5:	c0 
c01022e6:	83 e2 1f             	and    $0x1f,%edx
c01022e9:	88 14 c5 24 a1 11 c0 	mov    %dl,-0x3fee5edc(,%eax,8)
c01022f0:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01022f3:	0f b6 14 c5 25 a1 11 	movzbl -0x3fee5edb(,%eax,8),%edx
c01022fa:	c0 
c01022fb:	83 e2 f0             	and    $0xfffffff0,%edx
c01022fe:	83 ca 0e             	or     $0xe,%edx
c0102301:	88 14 c5 25 a1 11 c0 	mov    %dl,-0x3fee5edb(,%eax,8)
c0102308:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010230b:	0f b6 14 c5 25 a1 11 	movzbl -0x3fee5edb(,%eax,8),%edx
c0102312:	c0 
c0102313:	83 e2 ef             	and    $0xffffffef,%edx
c0102316:	88 14 c5 25 a1 11 c0 	mov    %dl,-0x3fee5edb(,%eax,8)
c010231d:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102320:	0f b6 14 c5 25 a1 11 	movzbl -0x3fee5edb(,%eax,8),%edx
c0102327:	c0 
c0102328:	83 e2 9f             	and    $0xffffff9f,%edx
c010232b:	88 14 c5 25 a1 11 c0 	mov    %dl,-0x3fee5edb(,%eax,8)
c0102332:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102335:	0f b6 14 c5 25 a1 11 	movzbl -0x3fee5edb(,%eax,8),%edx
c010233c:	c0 
c010233d:	83 ca 80             	or     $0xffffff80,%edx
c0102340:	88 14 c5 25 a1 11 c0 	mov    %dl,-0x3fee5edb(,%eax,8)
c0102347:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010234a:	8b 55 f8             	mov    -0x8(%ebp),%edx
c010234d:	8b 14 95 60 96 11 c0 	mov    -0x3fee69a0(,%edx,4),%edx
c0102354:	c1 ea 10             	shr    $0x10,%edx
c0102357:	66 89 14 c5 26 a1 11 	mov    %dx,-0x3fee5eda(,%eax,8)
c010235e:	c0 

void
idt_init(void) {
    extern uintptr_t __vectors[];
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c010235f:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
c0102363:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102366:	3d ff 00 00 00       	cmp    $0xff,%eax
c010236b:	0f 86 33 ff ff ff    	jbe    c01022a4 <idt_init+0x12>
c0102371:	c7 45 fc e0 95 11 c0 	movl   $0xc01195e0,-0x4(%ebp)
    }
}

static inline void
lidt(struct pseudodesc *pd) {
    asm volatile ("lidt (%0)" :: "r" (pd));
c0102378:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010237b:	0f 01 18             	lidtl  (%eax)
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
    }
    lidt(&idt_pd);
}
c010237e:	c9                   	leave  
c010237f:	c3                   	ret    

c0102380 <trapname>:

static const char *
trapname(int trapno) {
c0102380:	55                   	push   %ebp
c0102381:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c0102383:	8b 45 08             	mov    0x8(%ebp),%eax
c0102386:	83 f8 13             	cmp    $0x13,%eax
c0102389:	77 0c                	ja     c0102397 <trapname+0x17>
        return excnames[trapno];
c010238b:	8b 45 08             	mov    0x8(%ebp),%eax
c010238e:	8b 04 85 20 6c 10 c0 	mov    -0x3fef93e0(,%eax,4),%eax
c0102395:	eb 18                	jmp    c01023af <trapname+0x2f>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c0102397:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c010239b:	7e 0d                	jle    c01023aa <trapname+0x2a>
c010239d:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c01023a1:	7f 07                	jg     c01023aa <trapname+0x2a>
        return "Hardware Interrupt";
c01023a3:	b8 7f 68 10 c0       	mov    $0xc010687f,%eax
c01023a8:	eb 05                	jmp    c01023af <trapname+0x2f>
    }
    return "(unknown trap)";
c01023aa:	b8 92 68 10 c0       	mov    $0xc0106892,%eax
}
c01023af:	5d                   	pop    %ebp
c01023b0:	c3                   	ret    

c01023b1 <trap_in_kernel>:

bool
trap_in_kernel(struct trapframe *tf) {
c01023b1:	55                   	push   %ebp
c01023b2:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
c01023b4:	8b 45 08             	mov    0x8(%ebp),%eax
c01023b7:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c01023bb:	66 83 f8 08          	cmp    $0x8,%ax
c01023bf:	0f 94 c0             	sete   %al
c01023c2:	0f b6 c0             	movzbl %al,%eax
}
c01023c5:	5d                   	pop    %ebp
c01023c6:	c3                   	ret    

c01023c7 <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c01023c7:	55                   	push   %ebp
c01023c8:	89 e5                	mov    %esp,%ebp
c01023ca:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
c01023cd:	8b 45 08             	mov    0x8(%ebp),%eax
c01023d0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01023d4:	c7 04 24 d3 68 10 c0 	movl   $0xc01068d3,(%esp)
c01023db:	e8 cc dd ff ff       	call   c01001ac <cprintf>
    print_regs(&tf->tf_regs);
c01023e0:	8b 45 08             	mov    0x8(%ebp),%eax
c01023e3:	89 04 24             	mov    %eax,(%esp)
c01023e6:	e8 6d 01 00 00       	call   c0102558 <print_regs>
    cprintf("  es   0x----%04x\n", tf->tf_es);
c01023eb:	8b 45 08             	mov    0x8(%ebp),%eax
c01023ee:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c01023f2:	0f b7 c0             	movzwl %ax,%eax
c01023f5:	89 44 24 04          	mov    %eax,0x4(%esp)
c01023f9:	c7 04 24 e4 68 10 c0 	movl   $0xc01068e4,(%esp)
c0102400:	e8 a7 dd ff ff       	call   c01001ac <cprintf>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
c0102405:	8b 45 08             	mov    0x8(%ebp),%eax
c0102408:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c010240c:	0f b7 c0             	movzwl %ax,%eax
c010240f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102413:	c7 04 24 f7 68 10 c0 	movl   $0xc01068f7,(%esp)
c010241a:	e8 8d dd ff ff       	call   c01001ac <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c010241f:	8b 45 08             	mov    0x8(%ebp),%eax
c0102422:	8b 40 28             	mov    0x28(%eax),%eax
c0102425:	89 04 24             	mov    %eax,(%esp)
c0102428:	e8 53 ff ff ff       	call   c0102380 <trapname>
c010242d:	8b 55 08             	mov    0x8(%ebp),%edx
c0102430:	8b 52 28             	mov    0x28(%edx),%edx
c0102433:	89 44 24 08          	mov    %eax,0x8(%esp)
c0102437:	89 54 24 04          	mov    %edx,0x4(%esp)
c010243b:	c7 04 24 0a 69 10 c0 	movl   $0xc010690a,(%esp)
c0102442:	e8 65 dd ff ff       	call   c01001ac <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
c0102447:	8b 45 08             	mov    0x8(%ebp),%eax
c010244a:	8b 40 2c             	mov    0x2c(%eax),%eax
c010244d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102451:	c7 04 24 1c 69 10 c0 	movl   $0xc010691c,(%esp)
c0102458:	e8 4f dd ff ff       	call   c01001ac <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
c010245d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102460:	8b 40 30             	mov    0x30(%eax),%eax
c0102463:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102467:	c7 04 24 2b 69 10 c0 	movl   $0xc010692b,(%esp)
c010246e:	e8 39 dd ff ff       	call   c01001ac <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
c0102473:	8b 45 08             	mov    0x8(%ebp),%eax
c0102476:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c010247a:	0f b7 c0             	movzwl %ax,%eax
c010247d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102481:	c7 04 24 3a 69 10 c0 	movl   $0xc010693a,(%esp)
c0102488:	e8 1f dd ff ff       	call   c01001ac <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
c010248d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102490:	8b 40 38             	mov    0x38(%eax),%eax
c0102493:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102497:	c7 04 24 4d 69 10 c0 	movl   $0xc010694d,(%esp)
c010249e:	e8 09 dd ff ff       	call   c01001ac <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c01024a3:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c01024aa:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
c01024b1:	eb 3e                	jmp    c01024f1 <print_trapframe+0x12a>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c01024b3:	8b 45 08             	mov    0x8(%ebp),%eax
c01024b6:	8b 50 38             	mov    0x38(%eax),%edx
c01024b9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01024bc:	21 d0                	and    %edx,%eax
c01024be:	85 c0                	test   %eax,%eax
c01024c0:	74 28                	je     c01024ea <print_trapframe+0x123>
c01024c2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01024c5:	8b 04 85 00 96 11 c0 	mov    -0x3fee6a00(,%eax,4),%eax
c01024cc:	85 c0                	test   %eax,%eax
c01024ce:	74 1a                	je     c01024ea <print_trapframe+0x123>
            cprintf("%s,", IA32flags[i]);
c01024d0:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01024d3:	8b 04 85 00 96 11 c0 	mov    -0x3fee6a00(,%eax,4),%eax
c01024da:	89 44 24 04          	mov    %eax,0x4(%esp)
c01024de:	c7 04 24 5c 69 10 c0 	movl   $0xc010695c,(%esp)
c01024e5:	e8 c2 dc ff ff       	call   c01001ac <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
    cprintf("  flag 0x%08x ", tf->tf_eflags);

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c01024ea:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
c01024ee:	d1 65 f4             	shll   -0xc(%ebp)
c01024f1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01024f4:	83 f8 17             	cmp    $0x17,%eax
c01024f7:	76 ba                	jbe    c01024b3 <print_trapframe+0xec>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
            cprintf("%s,", IA32flags[i]);
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c01024f9:	8b 45 08             	mov    0x8(%ebp),%eax
c01024fc:	8b 40 38             	mov    0x38(%eax),%eax
c01024ff:	25 00 30 00 00       	and    $0x3000,%eax
c0102504:	c1 e8 0c             	shr    $0xc,%eax
c0102507:	89 44 24 04          	mov    %eax,0x4(%esp)
c010250b:	c7 04 24 60 69 10 c0 	movl   $0xc0106960,(%esp)
c0102512:	e8 95 dc ff ff       	call   c01001ac <cprintf>

    if (!trap_in_kernel(tf)) {
c0102517:	8b 45 08             	mov    0x8(%ebp),%eax
c010251a:	89 04 24             	mov    %eax,(%esp)
c010251d:	e8 8f fe ff ff       	call   c01023b1 <trap_in_kernel>
c0102522:	85 c0                	test   %eax,%eax
c0102524:	75 30                	jne    c0102556 <print_trapframe+0x18f>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
c0102526:	8b 45 08             	mov    0x8(%ebp),%eax
c0102529:	8b 40 3c             	mov    0x3c(%eax),%eax
c010252c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102530:	c7 04 24 69 69 10 c0 	movl   $0xc0106969,(%esp)
c0102537:	e8 70 dc ff ff       	call   c01001ac <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
c010253c:	8b 45 08             	mov    0x8(%ebp),%eax
c010253f:	0f b7 40 40          	movzwl 0x40(%eax),%eax
c0102543:	0f b7 c0             	movzwl %ax,%eax
c0102546:	89 44 24 04          	mov    %eax,0x4(%esp)
c010254a:	c7 04 24 78 69 10 c0 	movl   $0xc0106978,(%esp)
c0102551:	e8 56 dc ff ff       	call   c01001ac <cprintf>
    }
}
c0102556:	c9                   	leave  
c0102557:	c3                   	ret    

c0102558 <print_regs>:

void
print_regs(struct pushregs *regs) {
c0102558:	55                   	push   %ebp
c0102559:	89 e5                	mov    %esp,%ebp
c010255b:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
c010255e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102561:	8b 00                	mov    (%eax),%eax
c0102563:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102567:	c7 04 24 8b 69 10 c0 	movl   $0xc010698b,(%esp)
c010256e:	e8 39 dc ff ff       	call   c01001ac <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
c0102573:	8b 45 08             	mov    0x8(%ebp),%eax
c0102576:	8b 40 04             	mov    0x4(%eax),%eax
c0102579:	89 44 24 04          	mov    %eax,0x4(%esp)
c010257d:	c7 04 24 9a 69 10 c0 	movl   $0xc010699a,(%esp)
c0102584:	e8 23 dc ff ff       	call   c01001ac <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c0102589:	8b 45 08             	mov    0x8(%ebp),%eax
c010258c:	8b 40 08             	mov    0x8(%eax),%eax
c010258f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102593:	c7 04 24 a9 69 10 c0 	movl   $0xc01069a9,(%esp)
c010259a:	e8 0d dc ff ff       	call   c01001ac <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c010259f:	8b 45 08             	mov    0x8(%ebp),%eax
c01025a2:	8b 40 0c             	mov    0xc(%eax),%eax
c01025a5:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025a9:	c7 04 24 b8 69 10 c0 	movl   $0xc01069b8,(%esp)
c01025b0:	e8 f7 db ff ff       	call   c01001ac <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c01025b5:	8b 45 08             	mov    0x8(%ebp),%eax
c01025b8:	8b 40 10             	mov    0x10(%eax),%eax
c01025bb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025bf:	c7 04 24 c7 69 10 c0 	movl   $0xc01069c7,(%esp)
c01025c6:	e8 e1 db ff ff       	call   c01001ac <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
c01025cb:	8b 45 08             	mov    0x8(%ebp),%eax
c01025ce:	8b 40 14             	mov    0x14(%eax),%eax
c01025d1:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025d5:	c7 04 24 d6 69 10 c0 	movl   $0xc01069d6,(%esp)
c01025dc:	e8 cb db ff ff       	call   c01001ac <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c01025e1:	8b 45 08             	mov    0x8(%ebp),%eax
c01025e4:	8b 40 18             	mov    0x18(%eax),%eax
c01025e7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01025eb:	c7 04 24 e5 69 10 c0 	movl   $0xc01069e5,(%esp)
c01025f2:	e8 b5 db ff ff       	call   c01001ac <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
c01025f7:	8b 45 08             	mov    0x8(%ebp),%eax
c01025fa:	8b 40 1c             	mov    0x1c(%eax),%eax
c01025fd:	89 44 24 04          	mov    %eax,0x4(%esp)
c0102601:	c7 04 24 f4 69 10 c0 	movl   $0xc01069f4,(%esp)
c0102608:	e8 9f db ff ff       	call   c01001ac <cprintf>
}
c010260d:	c9                   	leave  
c010260e:	c3                   	ret    

c010260f <trap_dispatch>:

static void
trap_dispatch(struct trapframe *tf) {
c010260f:	55                   	push   %ebp
c0102610:	89 e5                	mov    %esp,%ebp
c0102612:	83 ec 28             	sub    $0x28,%esp
    char c;

    switch (tf->tf_trapno) {
c0102615:	8b 45 08             	mov    0x8(%ebp),%eax
c0102618:	8b 40 28             	mov    0x28(%eax),%eax
c010261b:	83 f8 24             	cmp    $0x24,%eax
c010261e:	0f 87 a9 00 00 00    	ja     c01026cd <trap_dispatch+0xbe>
c0102624:	8b 04 85 38 6a 10 c0 	mov    -0x3fef95c8(,%eax,4),%eax
c010262b:	ff e0                	jmp    *%eax
    case T_DEBUG:
    case T_BRKPT:
        debug_monitor(tf);
c010262d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102630:	89 04 24             	mov    %eax,(%esp)
c0102633:	e8 66 e8 ff ff       	call   c0100e9e <debug_monitor>
        break;
c0102638:	e9 c9 00 00 00       	jmp    c0102706 <trap_dispatch+0xf7>
    case IRQ_OFFSET + IRQ_TIMER:
        ticks ++;
c010263d:	a1 cc a9 11 c0       	mov    0xc011a9cc,%eax
c0102642:	83 c0 01             	add    $0x1,%eax
c0102645:	a3 cc a9 11 c0       	mov    %eax,0xc011a9cc
        if (ticks % TICK_NUM == 0) {
c010264a:	8b 0d cc a9 11 c0    	mov    0xc011a9cc,%ecx
c0102650:	ba 1f 85 eb 51       	mov    $0x51eb851f,%edx
c0102655:	89 c8                	mov    %ecx,%eax
c0102657:	f7 e2                	mul    %edx
c0102659:	89 d0                	mov    %edx,%eax
c010265b:	c1 e8 05             	shr    $0x5,%eax
c010265e:	6b c0 64             	imul   $0x64,%eax,%eax
c0102661:	89 ca                	mov    %ecx,%edx
c0102663:	29 c2                	sub    %eax,%edx
c0102665:	89 d0                	mov    %edx,%eax
c0102667:	85 c0                	test   %eax,%eax
c0102669:	0f 85 96 00 00 00    	jne    c0102705 <trap_dispatch+0xf6>
            print_ticks();
c010266f:	e8 dc fb ff ff       	call   c0102250 <print_ticks>
        }
        break;
c0102674:	e9 8d 00 00 00       	jmp    c0102706 <trap_dispatch+0xf7>
    case IRQ_OFFSET + IRQ_COM1:
    case IRQ_OFFSET + IRQ_KBD:
        if ((c = cons_getc()) == 13) {
c0102679:	e8 8d f9 ff ff       	call   c010200b <cons_getc>
c010267e:	88 45 f7             	mov    %al,-0x9(%ebp)
c0102681:	80 7d f7 0d          	cmpb   $0xd,-0x9(%ebp)
c0102685:	75 0d                	jne    c0102694 <trap_dispatch+0x85>
            debug_monitor(tf);
c0102687:	8b 45 08             	mov    0x8(%ebp),%eax
c010268a:	89 04 24             	mov    %eax,(%esp)
c010268d:	e8 0c e8 ff ff       	call   c0100e9e <debug_monitor>
        }
        else {
            cprintf("%s [%03d] %c\n",
                    (tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
        }
        break;
c0102692:	eb 72                	jmp    c0102706 <trap_dispatch+0xf7>
    case IRQ_OFFSET + IRQ_KBD:
        if ((c = cons_getc()) == 13) {
            debug_monitor(tf);
        }
        else {
            cprintf("%s [%03d] %c\n",
c0102694:	0f be 4d f7          	movsbl -0x9(%ebp),%ecx
c0102698:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
                    (tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
c010269c:	8b 45 08             	mov    0x8(%ebp),%eax
c010269f:	8b 40 28             	mov    0x28(%eax),%eax
    case IRQ_OFFSET + IRQ_KBD:
        if ((c = cons_getc()) == 13) {
            debug_monitor(tf);
        }
        else {
            cprintf("%s [%03d] %c\n",
c01026a2:	83 f8 21             	cmp    $0x21,%eax
c01026a5:	74 07                	je     c01026ae <trap_dispatch+0x9f>
c01026a7:	b8 03 6a 10 c0       	mov    $0xc0106a03,%eax
c01026ac:	eb 05                	jmp    c01026b3 <trap_dispatch+0xa4>
c01026ae:	b8 0a 6a 10 c0       	mov    $0xc0106a0a,%eax
c01026b3:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01026b7:	89 54 24 08          	mov    %edx,0x8(%esp)
c01026bb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01026bf:	c7 04 24 0e 6a 10 c0 	movl   $0xc0106a0e,(%esp)
c01026c6:	e8 e1 da ff ff       	call   c01001ac <cprintf>
                    (tf->tf_trapno != IRQ_OFFSET + IRQ_KBD) ? "serial" : "kbd", c, c);
        }
        break;
c01026cb:	eb 39                	jmp    c0102706 <trap_dispatch+0xf7>
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
c01026cd:	8b 45 08             	mov    0x8(%ebp),%eax
c01026d0:	0f b7 40 34          	movzwl 0x34(%eax),%eax
c01026d4:	0f b7 c0             	movzwl %ax,%eax
c01026d7:	83 e0 03             	and    $0x3,%eax
c01026da:	85 c0                	test   %eax,%eax
c01026dc:	75 28                	jne    c0102706 <trap_dispatch+0xf7>
            print_trapframe(tf);
c01026de:	8b 45 08             	mov    0x8(%ebp),%eax
c01026e1:	89 04 24             	mov    %eax,(%esp)
c01026e4:	e8 de fc ff ff       	call   c01023c7 <print_trapframe>
            panic("unexpected trap in kernel.\n");
c01026e9:	c7 44 24 08 1c 6a 10 	movl   $0xc0106a1c,0x8(%esp)
c01026f0:	c0 
c01026f1:	c7 44 24 04 96 00 00 	movl   $0x96,0x4(%esp)
c01026f8:	00 
c01026f9:	c7 04 24 6e 68 10 c0 	movl   $0xc010686e,(%esp)
c0102700:	e8 8b ef ff ff       	call   c0101690 <__panic>
    case IRQ_OFFSET + IRQ_TIMER:
        ticks ++;
        if (ticks % TICK_NUM == 0) {
            print_ticks();
        }
        break;
c0102705:	90                   	nop
        if ((tf->tf_cs & 3) == 0) {
            print_trapframe(tf);
            panic("unexpected trap in kernel.\n");
        }
    }
}
c0102706:	c9                   	leave  
c0102707:	c3                   	ret    

c0102708 <trap>:

void
trap(struct trapframe *tf) {
c0102708:	55                   	push   %ebp
c0102709:	89 e5                	mov    %esp,%ebp
c010270b:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
c010270e:	8b 45 08             	mov    0x8(%ebp),%eax
c0102711:	89 04 24             	mov    %eax,(%esp)
c0102714:	e8 f6 fe ff ff       	call   c010260f <trap_dispatch>
}
c0102719:	c9                   	leave  
c010271a:	c3                   	ret    
	...

c010271c <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
c010271c:	1e                   	push   %ds
    pushl %es
c010271d:	06                   	push   %es
    pushal
c010271e:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
c010271f:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c0102724:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c0102726:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
c0102728:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
c0102729:	e8 da ff ff ff       	call   c0102708 <trap>

    # pop the pushed stack pointer
    popl %esp
c010272e:	5c                   	pop    %esp

c010272f <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
c010272f:	61                   	popa   

    # restore %ds and %es
    popl %es
c0102730:	07                   	pop    %es
    popl %ds
c0102731:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
c0102732:	83 c4 08             	add    $0x8,%esp
    iret
c0102735:	cf                   	iret   
	...

c0102738 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c0102738:	6a 00                	push   $0x0
  pushl $0
c010273a:	6a 00                	push   $0x0
  jmp __alltraps
c010273c:	e9 db ff ff ff       	jmp    c010271c <__alltraps>

c0102741 <vector1>:
.globl vector1
vector1:
  pushl $0
c0102741:	6a 00                	push   $0x0
  pushl $1
c0102743:	6a 01                	push   $0x1
  jmp __alltraps
c0102745:	e9 d2 ff ff ff       	jmp    c010271c <__alltraps>

c010274a <vector2>:
.globl vector2
vector2:
  pushl $0
c010274a:	6a 00                	push   $0x0
  pushl $2
c010274c:	6a 02                	push   $0x2
  jmp __alltraps
c010274e:	e9 c9 ff ff ff       	jmp    c010271c <__alltraps>

c0102753 <vector3>:
.globl vector3
vector3:
  pushl $0
c0102753:	6a 00                	push   $0x0
  pushl $3
c0102755:	6a 03                	push   $0x3
  jmp __alltraps
c0102757:	e9 c0 ff ff ff       	jmp    c010271c <__alltraps>

c010275c <vector4>:
.globl vector4
vector4:
  pushl $0
c010275c:	6a 00                	push   $0x0
  pushl $4
c010275e:	6a 04                	push   $0x4
  jmp __alltraps
c0102760:	e9 b7 ff ff ff       	jmp    c010271c <__alltraps>

c0102765 <vector5>:
.globl vector5
vector5:
  pushl $0
c0102765:	6a 00                	push   $0x0
  pushl $5
c0102767:	6a 05                	push   $0x5
  jmp __alltraps
c0102769:	e9 ae ff ff ff       	jmp    c010271c <__alltraps>

c010276e <vector6>:
.globl vector6
vector6:
  pushl $0
c010276e:	6a 00                	push   $0x0
  pushl $6
c0102770:	6a 06                	push   $0x6
  jmp __alltraps
c0102772:	e9 a5 ff ff ff       	jmp    c010271c <__alltraps>

c0102777 <vector7>:
.globl vector7
vector7:
  pushl $0
c0102777:	6a 00                	push   $0x0
  pushl $7
c0102779:	6a 07                	push   $0x7
  jmp __alltraps
c010277b:	e9 9c ff ff ff       	jmp    c010271c <__alltraps>

c0102780 <vector8>:
.globl vector8
vector8:
  pushl $8
c0102780:	6a 08                	push   $0x8
  jmp __alltraps
c0102782:	e9 95 ff ff ff       	jmp    c010271c <__alltraps>

c0102787 <vector9>:
.globl vector9
vector9:
  pushl $9
c0102787:	6a 09                	push   $0x9
  jmp __alltraps
c0102789:	e9 8e ff ff ff       	jmp    c010271c <__alltraps>

c010278e <vector10>:
.globl vector10
vector10:
  pushl $10
c010278e:	6a 0a                	push   $0xa
  jmp __alltraps
c0102790:	e9 87 ff ff ff       	jmp    c010271c <__alltraps>

c0102795 <vector11>:
.globl vector11
vector11:
  pushl $11
c0102795:	6a 0b                	push   $0xb
  jmp __alltraps
c0102797:	e9 80 ff ff ff       	jmp    c010271c <__alltraps>

c010279c <vector12>:
.globl vector12
vector12:
  pushl $12
c010279c:	6a 0c                	push   $0xc
  jmp __alltraps
c010279e:	e9 79 ff ff ff       	jmp    c010271c <__alltraps>

c01027a3 <vector13>:
.globl vector13
vector13:
  pushl $13
c01027a3:	6a 0d                	push   $0xd
  jmp __alltraps
c01027a5:	e9 72 ff ff ff       	jmp    c010271c <__alltraps>

c01027aa <vector14>:
.globl vector14
vector14:
  pushl $14
c01027aa:	6a 0e                	push   $0xe
  jmp __alltraps
c01027ac:	e9 6b ff ff ff       	jmp    c010271c <__alltraps>

c01027b1 <vector15>:
.globl vector15
vector15:
  pushl $0
c01027b1:	6a 00                	push   $0x0
  pushl $15
c01027b3:	6a 0f                	push   $0xf
  jmp __alltraps
c01027b5:	e9 62 ff ff ff       	jmp    c010271c <__alltraps>

c01027ba <vector16>:
.globl vector16
vector16:
  pushl $0
c01027ba:	6a 00                	push   $0x0
  pushl $16
c01027bc:	6a 10                	push   $0x10
  jmp __alltraps
c01027be:	e9 59 ff ff ff       	jmp    c010271c <__alltraps>

c01027c3 <vector17>:
.globl vector17
vector17:
  pushl $17
c01027c3:	6a 11                	push   $0x11
  jmp __alltraps
c01027c5:	e9 52 ff ff ff       	jmp    c010271c <__alltraps>

c01027ca <vector18>:
.globl vector18
vector18:
  pushl $0
c01027ca:	6a 00                	push   $0x0
  pushl $18
c01027cc:	6a 12                	push   $0x12
  jmp __alltraps
c01027ce:	e9 49 ff ff ff       	jmp    c010271c <__alltraps>

c01027d3 <vector19>:
.globl vector19
vector19:
  pushl $0
c01027d3:	6a 00                	push   $0x0
  pushl $19
c01027d5:	6a 13                	push   $0x13
  jmp __alltraps
c01027d7:	e9 40 ff ff ff       	jmp    c010271c <__alltraps>

c01027dc <vector20>:
.globl vector20
vector20:
  pushl $0
c01027dc:	6a 00                	push   $0x0
  pushl $20
c01027de:	6a 14                	push   $0x14
  jmp __alltraps
c01027e0:	e9 37 ff ff ff       	jmp    c010271c <__alltraps>

c01027e5 <vector21>:
.globl vector21
vector21:
  pushl $0
c01027e5:	6a 00                	push   $0x0
  pushl $21
c01027e7:	6a 15                	push   $0x15
  jmp __alltraps
c01027e9:	e9 2e ff ff ff       	jmp    c010271c <__alltraps>

c01027ee <vector22>:
.globl vector22
vector22:
  pushl $0
c01027ee:	6a 00                	push   $0x0
  pushl $22
c01027f0:	6a 16                	push   $0x16
  jmp __alltraps
c01027f2:	e9 25 ff ff ff       	jmp    c010271c <__alltraps>

c01027f7 <vector23>:
.globl vector23
vector23:
  pushl $0
c01027f7:	6a 00                	push   $0x0
  pushl $23
c01027f9:	6a 17                	push   $0x17
  jmp __alltraps
c01027fb:	e9 1c ff ff ff       	jmp    c010271c <__alltraps>

c0102800 <vector24>:
.globl vector24
vector24:
  pushl $0
c0102800:	6a 00                	push   $0x0
  pushl $24
c0102802:	6a 18                	push   $0x18
  jmp __alltraps
c0102804:	e9 13 ff ff ff       	jmp    c010271c <__alltraps>

c0102809 <vector25>:
.globl vector25
vector25:
  pushl $0
c0102809:	6a 00                	push   $0x0
  pushl $25
c010280b:	6a 19                	push   $0x19
  jmp __alltraps
c010280d:	e9 0a ff ff ff       	jmp    c010271c <__alltraps>

c0102812 <vector26>:
.globl vector26
vector26:
  pushl $0
c0102812:	6a 00                	push   $0x0
  pushl $26
c0102814:	6a 1a                	push   $0x1a
  jmp __alltraps
c0102816:	e9 01 ff ff ff       	jmp    c010271c <__alltraps>

c010281b <vector27>:
.globl vector27
vector27:
  pushl $0
c010281b:	6a 00                	push   $0x0
  pushl $27
c010281d:	6a 1b                	push   $0x1b
  jmp __alltraps
c010281f:	e9 f8 fe ff ff       	jmp    c010271c <__alltraps>

c0102824 <vector28>:
.globl vector28
vector28:
  pushl $0
c0102824:	6a 00                	push   $0x0
  pushl $28
c0102826:	6a 1c                	push   $0x1c
  jmp __alltraps
c0102828:	e9 ef fe ff ff       	jmp    c010271c <__alltraps>

c010282d <vector29>:
.globl vector29
vector29:
  pushl $0
c010282d:	6a 00                	push   $0x0
  pushl $29
c010282f:	6a 1d                	push   $0x1d
  jmp __alltraps
c0102831:	e9 e6 fe ff ff       	jmp    c010271c <__alltraps>

c0102836 <vector30>:
.globl vector30
vector30:
  pushl $0
c0102836:	6a 00                	push   $0x0
  pushl $30
c0102838:	6a 1e                	push   $0x1e
  jmp __alltraps
c010283a:	e9 dd fe ff ff       	jmp    c010271c <__alltraps>

c010283f <vector31>:
.globl vector31
vector31:
  pushl $0
c010283f:	6a 00                	push   $0x0
  pushl $31
c0102841:	6a 1f                	push   $0x1f
  jmp __alltraps
c0102843:	e9 d4 fe ff ff       	jmp    c010271c <__alltraps>

c0102848 <vector32>:
.globl vector32
vector32:
  pushl $0
c0102848:	6a 00                	push   $0x0
  pushl $32
c010284a:	6a 20                	push   $0x20
  jmp __alltraps
c010284c:	e9 cb fe ff ff       	jmp    c010271c <__alltraps>

c0102851 <vector33>:
.globl vector33
vector33:
  pushl $0
c0102851:	6a 00                	push   $0x0
  pushl $33
c0102853:	6a 21                	push   $0x21
  jmp __alltraps
c0102855:	e9 c2 fe ff ff       	jmp    c010271c <__alltraps>

c010285a <vector34>:
.globl vector34
vector34:
  pushl $0
c010285a:	6a 00                	push   $0x0
  pushl $34
c010285c:	6a 22                	push   $0x22
  jmp __alltraps
c010285e:	e9 b9 fe ff ff       	jmp    c010271c <__alltraps>

c0102863 <vector35>:
.globl vector35
vector35:
  pushl $0
c0102863:	6a 00                	push   $0x0
  pushl $35
c0102865:	6a 23                	push   $0x23
  jmp __alltraps
c0102867:	e9 b0 fe ff ff       	jmp    c010271c <__alltraps>

c010286c <vector36>:
.globl vector36
vector36:
  pushl $0
c010286c:	6a 00                	push   $0x0
  pushl $36
c010286e:	6a 24                	push   $0x24
  jmp __alltraps
c0102870:	e9 a7 fe ff ff       	jmp    c010271c <__alltraps>

c0102875 <vector37>:
.globl vector37
vector37:
  pushl $0
c0102875:	6a 00                	push   $0x0
  pushl $37
c0102877:	6a 25                	push   $0x25
  jmp __alltraps
c0102879:	e9 9e fe ff ff       	jmp    c010271c <__alltraps>

c010287e <vector38>:
.globl vector38
vector38:
  pushl $0
c010287e:	6a 00                	push   $0x0
  pushl $38
c0102880:	6a 26                	push   $0x26
  jmp __alltraps
c0102882:	e9 95 fe ff ff       	jmp    c010271c <__alltraps>

c0102887 <vector39>:
.globl vector39
vector39:
  pushl $0
c0102887:	6a 00                	push   $0x0
  pushl $39
c0102889:	6a 27                	push   $0x27
  jmp __alltraps
c010288b:	e9 8c fe ff ff       	jmp    c010271c <__alltraps>

c0102890 <vector40>:
.globl vector40
vector40:
  pushl $0
c0102890:	6a 00                	push   $0x0
  pushl $40
c0102892:	6a 28                	push   $0x28
  jmp __alltraps
c0102894:	e9 83 fe ff ff       	jmp    c010271c <__alltraps>

c0102899 <vector41>:
.globl vector41
vector41:
  pushl $0
c0102899:	6a 00                	push   $0x0
  pushl $41
c010289b:	6a 29                	push   $0x29
  jmp __alltraps
c010289d:	e9 7a fe ff ff       	jmp    c010271c <__alltraps>

c01028a2 <vector42>:
.globl vector42
vector42:
  pushl $0
c01028a2:	6a 00                	push   $0x0
  pushl $42
c01028a4:	6a 2a                	push   $0x2a
  jmp __alltraps
c01028a6:	e9 71 fe ff ff       	jmp    c010271c <__alltraps>

c01028ab <vector43>:
.globl vector43
vector43:
  pushl $0
c01028ab:	6a 00                	push   $0x0
  pushl $43
c01028ad:	6a 2b                	push   $0x2b
  jmp __alltraps
c01028af:	e9 68 fe ff ff       	jmp    c010271c <__alltraps>

c01028b4 <vector44>:
.globl vector44
vector44:
  pushl $0
c01028b4:	6a 00                	push   $0x0
  pushl $44
c01028b6:	6a 2c                	push   $0x2c
  jmp __alltraps
c01028b8:	e9 5f fe ff ff       	jmp    c010271c <__alltraps>

c01028bd <vector45>:
.globl vector45
vector45:
  pushl $0
c01028bd:	6a 00                	push   $0x0
  pushl $45
c01028bf:	6a 2d                	push   $0x2d
  jmp __alltraps
c01028c1:	e9 56 fe ff ff       	jmp    c010271c <__alltraps>

c01028c6 <vector46>:
.globl vector46
vector46:
  pushl $0
c01028c6:	6a 00                	push   $0x0
  pushl $46
c01028c8:	6a 2e                	push   $0x2e
  jmp __alltraps
c01028ca:	e9 4d fe ff ff       	jmp    c010271c <__alltraps>

c01028cf <vector47>:
.globl vector47
vector47:
  pushl $0
c01028cf:	6a 00                	push   $0x0
  pushl $47
c01028d1:	6a 2f                	push   $0x2f
  jmp __alltraps
c01028d3:	e9 44 fe ff ff       	jmp    c010271c <__alltraps>

c01028d8 <vector48>:
.globl vector48
vector48:
  pushl $0
c01028d8:	6a 00                	push   $0x0
  pushl $48
c01028da:	6a 30                	push   $0x30
  jmp __alltraps
c01028dc:	e9 3b fe ff ff       	jmp    c010271c <__alltraps>

c01028e1 <vector49>:
.globl vector49
vector49:
  pushl $0
c01028e1:	6a 00                	push   $0x0
  pushl $49
c01028e3:	6a 31                	push   $0x31
  jmp __alltraps
c01028e5:	e9 32 fe ff ff       	jmp    c010271c <__alltraps>

c01028ea <vector50>:
.globl vector50
vector50:
  pushl $0
c01028ea:	6a 00                	push   $0x0
  pushl $50
c01028ec:	6a 32                	push   $0x32
  jmp __alltraps
c01028ee:	e9 29 fe ff ff       	jmp    c010271c <__alltraps>

c01028f3 <vector51>:
.globl vector51
vector51:
  pushl $0
c01028f3:	6a 00                	push   $0x0
  pushl $51
c01028f5:	6a 33                	push   $0x33
  jmp __alltraps
c01028f7:	e9 20 fe ff ff       	jmp    c010271c <__alltraps>

c01028fc <vector52>:
.globl vector52
vector52:
  pushl $0
c01028fc:	6a 00                	push   $0x0
  pushl $52
c01028fe:	6a 34                	push   $0x34
  jmp __alltraps
c0102900:	e9 17 fe ff ff       	jmp    c010271c <__alltraps>

c0102905 <vector53>:
.globl vector53
vector53:
  pushl $0
c0102905:	6a 00                	push   $0x0
  pushl $53
c0102907:	6a 35                	push   $0x35
  jmp __alltraps
c0102909:	e9 0e fe ff ff       	jmp    c010271c <__alltraps>

c010290e <vector54>:
.globl vector54
vector54:
  pushl $0
c010290e:	6a 00                	push   $0x0
  pushl $54
c0102910:	6a 36                	push   $0x36
  jmp __alltraps
c0102912:	e9 05 fe ff ff       	jmp    c010271c <__alltraps>

c0102917 <vector55>:
.globl vector55
vector55:
  pushl $0
c0102917:	6a 00                	push   $0x0
  pushl $55
c0102919:	6a 37                	push   $0x37
  jmp __alltraps
c010291b:	e9 fc fd ff ff       	jmp    c010271c <__alltraps>

c0102920 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102920:	6a 00                	push   $0x0
  pushl $56
c0102922:	6a 38                	push   $0x38
  jmp __alltraps
c0102924:	e9 f3 fd ff ff       	jmp    c010271c <__alltraps>

c0102929 <vector57>:
.globl vector57
vector57:
  pushl $0
c0102929:	6a 00                	push   $0x0
  pushl $57
c010292b:	6a 39                	push   $0x39
  jmp __alltraps
c010292d:	e9 ea fd ff ff       	jmp    c010271c <__alltraps>

c0102932 <vector58>:
.globl vector58
vector58:
  pushl $0
c0102932:	6a 00                	push   $0x0
  pushl $58
c0102934:	6a 3a                	push   $0x3a
  jmp __alltraps
c0102936:	e9 e1 fd ff ff       	jmp    c010271c <__alltraps>

c010293b <vector59>:
.globl vector59
vector59:
  pushl $0
c010293b:	6a 00                	push   $0x0
  pushl $59
c010293d:	6a 3b                	push   $0x3b
  jmp __alltraps
c010293f:	e9 d8 fd ff ff       	jmp    c010271c <__alltraps>

c0102944 <vector60>:
.globl vector60
vector60:
  pushl $0
c0102944:	6a 00                	push   $0x0
  pushl $60
c0102946:	6a 3c                	push   $0x3c
  jmp __alltraps
c0102948:	e9 cf fd ff ff       	jmp    c010271c <__alltraps>

c010294d <vector61>:
.globl vector61
vector61:
  pushl $0
c010294d:	6a 00                	push   $0x0
  pushl $61
c010294f:	6a 3d                	push   $0x3d
  jmp __alltraps
c0102951:	e9 c6 fd ff ff       	jmp    c010271c <__alltraps>

c0102956 <vector62>:
.globl vector62
vector62:
  pushl $0
c0102956:	6a 00                	push   $0x0
  pushl $62
c0102958:	6a 3e                	push   $0x3e
  jmp __alltraps
c010295a:	e9 bd fd ff ff       	jmp    c010271c <__alltraps>

c010295f <vector63>:
.globl vector63
vector63:
  pushl $0
c010295f:	6a 00                	push   $0x0
  pushl $63
c0102961:	6a 3f                	push   $0x3f
  jmp __alltraps
c0102963:	e9 b4 fd ff ff       	jmp    c010271c <__alltraps>

c0102968 <vector64>:
.globl vector64
vector64:
  pushl $0
c0102968:	6a 00                	push   $0x0
  pushl $64
c010296a:	6a 40                	push   $0x40
  jmp __alltraps
c010296c:	e9 ab fd ff ff       	jmp    c010271c <__alltraps>

c0102971 <vector65>:
.globl vector65
vector65:
  pushl $0
c0102971:	6a 00                	push   $0x0
  pushl $65
c0102973:	6a 41                	push   $0x41
  jmp __alltraps
c0102975:	e9 a2 fd ff ff       	jmp    c010271c <__alltraps>

c010297a <vector66>:
.globl vector66
vector66:
  pushl $0
c010297a:	6a 00                	push   $0x0
  pushl $66
c010297c:	6a 42                	push   $0x42
  jmp __alltraps
c010297e:	e9 99 fd ff ff       	jmp    c010271c <__alltraps>

c0102983 <vector67>:
.globl vector67
vector67:
  pushl $0
c0102983:	6a 00                	push   $0x0
  pushl $67
c0102985:	6a 43                	push   $0x43
  jmp __alltraps
c0102987:	e9 90 fd ff ff       	jmp    c010271c <__alltraps>

c010298c <vector68>:
.globl vector68
vector68:
  pushl $0
c010298c:	6a 00                	push   $0x0
  pushl $68
c010298e:	6a 44                	push   $0x44
  jmp __alltraps
c0102990:	e9 87 fd ff ff       	jmp    c010271c <__alltraps>

c0102995 <vector69>:
.globl vector69
vector69:
  pushl $0
c0102995:	6a 00                	push   $0x0
  pushl $69
c0102997:	6a 45                	push   $0x45
  jmp __alltraps
c0102999:	e9 7e fd ff ff       	jmp    c010271c <__alltraps>

c010299e <vector70>:
.globl vector70
vector70:
  pushl $0
c010299e:	6a 00                	push   $0x0
  pushl $70
c01029a0:	6a 46                	push   $0x46
  jmp __alltraps
c01029a2:	e9 75 fd ff ff       	jmp    c010271c <__alltraps>

c01029a7 <vector71>:
.globl vector71
vector71:
  pushl $0
c01029a7:	6a 00                	push   $0x0
  pushl $71
c01029a9:	6a 47                	push   $0x47
  jmp __alltraps
c01029ab:	e9 6c fd ff ff       	jmp    c010271c <__alltraps>

c01029b0 <vector72>:
.globl vector72
vector72:
  pushl $0
c01029b0:	6a 00                	push   $0x0
  pushl $72
c01029b2:	6a 48                	push   $0x48
  jmp __alltraps
c01029b4:	e9 63 fd ff ff       	jmp    c010271c <__alltraps>

c01029b9 <vector73>:
.globl vector73
vector73:
  pushl $0
c01029b9:	6a 00                	push   $0x0
  pushl $73
c01029bb:	6a 49                	push   $0x49
  jmp __alltraps
c01029bd:	e9 5a fd ff ff       	jmp    c010271c <__alltraps>

c01029c2 <vector74>:
.globl vector74
vector74:
  pushl $0
c01029c2:	6a 00                	push   $0x0
  pushl $74
c01029c4:	6a 4a                	push   $0x4a
  jmp __alltraps
c01029c6:	e9 51 fd ff ff       	jmp    c010271c <__alltraps>

c01029cb <vector75>:
.globl vector75
vector75:
  pushl $0
c01029cb:	6a 00                	push   $0x0
  pushl $75
c01029cd:	6a 4b                	push   $0x4b
  jmp __alltraps
c01029cf:	e9 48 fd ff ff       	jmp    c010271c <__alltraps>

c01029d4 <vector76>:
.globl vector76
vector76:
  pushl $0
c01029d4:	6a 00                	push   $0x0
  pushl $76
c01029d6:	6a 4c                	push   $0x4c
  jmp __alltraps
c01029d8:	e9 3f fd ff ff       	jmp    c010271c <__alltraps>

c01029dd <vector77>:
.globl vector77
vector77:
  pushl $0
c01029dd:	6a 00                	push   $0x0
  pushl $77
c01029df:	6a 4d                	push   $0x4d
  jmp __alltraps
c01029e1:	e9 36 fd ff ff       	jmp    c010271c <__alltraps>

c01029e6 <vector78>:
.globl vector78
vector78:
  pushl $0
c01029e6:	6a 00                	push   $0x0
  pushl $78
c01029e8:	6a 4e                	push   $0x4e
  jmp __alltraps
c01029ea:	e9 2d fd ff ff       	jmp    c010271c <__alltraps>

c01029ef <vector79>:
.globl vector79
vector79:
  pushl $0
c01029ef:	6a 00                	push   $0x0
  pushl $79
c01029f1:	6a 4f                	push   $0x4f
  jmp __alltraps
c01029f3:	e9 24 fd ff ff       	jmp    c010271c <__alltraps>

c01029f8 <vector80>:
.globl vector80
vector80:
  pushl $0
c01029f8:	6a 00                	push   $0x0
  pushl $80
c01029fa:	6a 50                	push   $0x50
  jmp __alltraps
c01029fc:	e9 1b fd ff ff       	jmp    c010271c <__alltraps>

c0102a01 <vector81>:
.globl vector81
vector81:
  pushl $0
c0102a01:	6a 00                	push   $0x0
  pushl $81
c0102a03:	6a 51                	push   $0x51
  jmp __alltraps
c0102a05:	e9 12 fd ff ff       	jmp    c010271c <__alltraps>

c0102a0a <vector82>:
.globl vector82
vector82:
  pushl $0
c0102a0a:	6a 00                	push   $0x0
  pushl $82
c0102a0c:	6a 52                	push   $0x52
  jmp __alltraps
c0102a0e:	e9 09 fd ff ff       	jmp    c010271c <__alltraps>

c0102a13 <vector83>:
.globl vector83
vector83:
  pushl $0
c0102a13:	6a 00                	push   $0x0
  pushl $83
c0102a15:	6a 53                	push   $0x53
  jmp __alltraps
c0102a17:	e9 00 fd ff ff       	jmp    c010271c <__alltraps>

c0102a1c <vector84>:
.globl vector84
vector84:
  pushl $0
c0102a1c:	6a 00                	push   $0x0
  pushl $84
c0102a1e:	6a 54                	push   $0x54
  jmp __alltraps
c0102a20:	e9 f7 fc ff ff       	jmp    c010271c <__alltraps>

c0102a25 <vector85>:
.globl vector85
vector85:
  pushl $0
c0102a25:	6a 00                	push   $0x0
  pushl $85
c0102a27:	6a 55                	push   $0x55
  jmp __alltraps
c0102a29:	e9 ee fc ff ff       	jmp    c010271c <__alltraps>

c0102a2e <vector86>:
.globl vector86
vector86:
  pushl $0
c0102a2e:	6a 00                	push   $0x0
  pushl $86
c0102a30:	6a 56                	push   $0x56
  jmp __alltraps
c0102a32:	e9 e5 fc ff ff       	jmp    c010271c <__alltraps>

c0102a37 <vector87>:
.globl vector87
vector87:
  pushl $0
c0102a37:	6a 00                	push   $0x0
  pushl $87
c0102a39:	6a 57                	push   $0x57
  jmp __alltraps
c0102a3b:	e9 dc fc ff ff       	jmp    c010271c <__alltraps>

c0102a40 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102a40:	6a 00                	push   $0x0
  pushl $88
c0102a42:	6a 58                	push   $0x58
  jmp __alltraps
c0102a44:	e9 d3 fc ff ff       	jmp    c010271c <__alltraps>

c0102a49 <vector89>:
.globl vector89
vector89:
  pushl $0
c0102a49:	6a 00                	push   $0x0
  pushl $89
c0102a4b:	6a 59                	push   $0x59
  jmp __alltraps
c0102a4d:	e9 ca fc ff ff       	jmp    c010271c <__alltraps>

c0102a52 <vector90>:
.globl vector90
vector90:
  pushl $0
c0102a52:	6a 00                	push   $0x0
  pushl $90
c0102a54:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102a56:	e9 c1 fc ff ff       	jmp    c010271c <__alltraps>

c0102a5b <vector91>:
.globl vector91
vector91:
  pushl $0
c0102a5b:	6a 00                	push   $0x0
  pushl $91
c0102a5d:	6a 5b                	push   $0x5b
  jmp __alltraps
c0102a5f:	e9 b8 fc ff ff       	jmp    c010271c <__alltraps>

c0102a64 <vector92>:
.globl vector92
vector92:
  pushl $0
c0102a64:	6a 00                	push   $0x0
  pushl $92
c0102a66:	6a 5c                	push   $0x5c
  jmp __alltraps
c0102a68:	e9 af fc ff ff       	jmp    c010271c <__alltraps>

c0102a6d <vector93>:
.globl vector93
vector93:
  pushl $0
c0102a6d:	6a 00                	push   $0x0
  pushl $93
c0102a6f:	6a 5d                	push   $0x5d
  jmp __alltraps
c0102a71:	e9 a6 fc ff ff       	jmp    c010271c <__alltraps>

c0102a76 <vector94>:
.globl vector94
vector94:
  pushl $0
c0102a76:	6a 00                	push   $0x0
  pushl $94
c0102a78:	6a 5e                	push   $0x5e
  jmp __alltraps
c0102a7a:	e9 9d fc ff ff       	jmp    c010271c <__alltraps>

c0102a7f <vector95>:
.globl vector95
vector95:
  pushl $0
c0102a7f:	6a 00                	push   $0x0
  pushl $95
c0102a81:	6a 5f                	push   $0x5f
  jmp __alltraps
c0102a83:	e9 94 fc ff ff       	jmp    c010271c <__alltraps>

c0102a88 <vector96>:
.globl vector96
vector96:
  pushl $0
c0102a88:	6a 00                	push   $0x0
  pushl $96
c0102a8a:	6a 60                	push   $0x60
  jmp __alltraps
c0102a8c:	e9 8b fc ff ff       	jmp    c010271c <__alltraps>

c0102a91 <vector97>:
.globl vector97
vector97:
  pushl $0
c0102a91:	6a 00                	push   $0x0
  pushl $97
c0102a93:	6a 61                	push   $0x61
  jmp __alltraps
c0102a95:	e9 82 fc ff ff       	jmp    c010271c <__alltraps>

c0102a9a <vector98>:
.globl vector98
vector98:
  pushl $0
c0102a9a:	6a 00                	push   $0x0
  pushl $98
c0102a9c:	6a 62                	push   $0x62
  jmp __alltraps
c0102a9e:	e9 79 fc ff ff       	jmp    c010271c <__alltraps>

c0102aa3 <vector99>:
.globl vector99
vector99:
  pushl $0
c0102aa3:	6a 00                	push   $0x0
  pushl $99
c0102aa5:	6a 63                	push   $0x63
  jmp __alltraps
c0102aa7:	e9 70 fc ff ff       	jmp    c010271c <__alltraps>

c0102aac <vector100>:
.globl vector100
vector100:
  pushl $0
c0102aac:	6a 00                	push   $0x0
  pushl $100
c0102aae:	6a 64                	push   $0x64
  jmp __alltraps
c0102ab0:	e9 67 fc ff ff       	jmp    c010271c <__alltraps>

c0102ab5 <vector101>:
.globl vector101
vector101:
  pushl $0
c0102ab5:	6a 00                	push   $0x0
  pushl $101
c0102ab7:	6a 65                	push   $0x65
  jmp __alltraps
c0102ab9:	e9 5e fc ff ff       	jmp    c010271c <__alltraps>

c0102abe <vector102>:
.globl vector102
vector102:
  pushl $0
c0102abe:	6a 00                	push   $0x0
  pushl $102
c0102ac0:	6a 66                	push   $0x66
  jmp __alltraps
c0102ac2:	e9 55 fc ff ff       	jmp    c010271c <__alltraps>

c0102ac7 <vector103>:
.globl vector103
vector103:
  pushl $0
c0102ac7:	6a 00                	push   $0x0
  pushl $103
c0102ac9:	6a 67                	push   $0x67
  jmp __alltraps
c0102acb:	e9 4c fc ff ff       	jmp    c010271c <__alltraps>

c0102ad0 <vector104>:
.globl vector104
vector104:
  pushl $0
c0102ad0:	6a 00                	push   $0x0
  pushl $104
c0102ad2:	6a 68                	push   $0x68
  jmp __alltraps
c0102ad4:	e9 43 fc ff ff       	jmp    c010271c <__alltraps>

c0102ad9 <vector105>:
.globl vector105
vector105:
  pushl $0
c0102ad9:	6a 00                	push   $0x0
  pushl $105
c0102adb:	6a 69                	push   $0x69
  jmp __alltraps
c0102add:	e9 3a fc ff ff       	jmp    c010271c <__alltraps>

c0102ae2 <vector106>:
.globl vector106
vector106:
  pushl $0
c0102ae2:	6a 00                	push   $0x0
  pushl $106
c0102ae4:	6a 6a                	push   $0x6a
  jmp __alltraps
c0102ae6:	e9 31 fc ff ff       	jmp    c010271c <__alltraps>

c0102aeb <vector107>:
.globl vector107
vector107:
  pushl $0
c0102aeb:	6a 00                	push   $0x0
  pushl $107
c0102aed:	6a 6b                	push   $0x6b
  jmp __alltraps
c0102aef:	e9 28 fc ff ff       	jmp    c010271c <__alltraps>

c0102af4 <vector108>:
.globl vector108
vector108:
  pushl $0
c0102af4:	6a 00                	push   $0x0
  pushl $108
c0102af6:	6a 6c                	push   $0x6c
  jmp __alltraps
c0102af8:	e9 1f fc ff ff       	jmp    c010271c <__alltraps>

c0102afd <vector109>:
.globl vector109
vector109:
  pushl $0
c0102afd:	6a 00                	push   $0x0
  pushl $109
c0102aff:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102b01:	e9 16 fc ff ff       	jmp    c010271c <__alltraps>

c0102b06 <vector110>:
.globl vector110
vector110:
  pushl $0
c0102b06:	6a 00                	push   $0x0
  pushl $110
c0102b08:	6a 6e                	push   $0x6e
  jmp __alltraps
c0102b0a:	e9 0d fc ff ff       	jmp    c010271c <__alltraps>

c0102b0f <vector111>:
.globl vector111
vector111:
  pushl $0
c0102b0f:	6a 00                	push   $0x0
  pushl $111
c0102b11:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102b13:	e9 04 fc ff ff       	jmp    c010271c <__alltraps>

c0102b18 <vector112>:
.globl vector112
vector112:
  pushl $0
c0102b18:	6a 00                	push   $0x0
  pushl $112
c0102b1a:	6a 70                	push   $0x70
  jmp __alltraps
c0102b1c:	e9 fb fb ff ff       	jmp    c010271c <__alltraps>

c0102b21 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102b21:	6a 00                	push   $0x0
  pushl $113
c0102b23:	6a 71                	push   $0x71
  jmp __alltraps
c0102b25:	e9 f2 fb ff ff       	jmp    c010271c <__alltraps>

c0102b2a <vector114>:
.globl vector114
vector114:
  pushl $0
c0102b2a:	6a 00                	push   $0x0
  pushl $114
c0102b2c:	6a 72                	push   $0x72
  jmp __alltraps
c0102b2e:	e9 e9 fb ff ff       	jmp    c010271c <__alltraps>

c0102b33 <vector115>:
.globl vector115
vector115:
  pushl $0
c0102b33:	6a 00                	push   $0x0
  pushl $115
c0102b35:	6a 73                	push   $0x73
  jmp __alltraps
c0102b37:	e9 e0 fb ff ff       	jmp    c010271c <__alltraps>

c0102b3c <vector116>:
.globl vector116
vector116:
  pushl $0
c0102b3c:	6a 00                	push   $0x0
  pushl $116
c0102b3e:	6a 74                	push   $0x74
  jmp __alltraps
c0102b40:	e9 d7 fb ff ff       	jmp    c010271c <__alltraps>

c0102b45 <vector117>:
.globl vector117
vector117:
  pushl $0
c0102b45:	6a 00                	push   $0x0
  pushl $117
c0102b47:	6a 75                	push   $0x75
  jmp __alltraps
c0102b49:	e9 ce fb ff ff       	jmp    c010271c <__alltraps>

c0102b4e <vector118>:
.globl vector118
vector118:
  pushl $0
c0102b4e:	6a 00                	push   $0x0
  pushl $118
c0102b50:	6a 76                	push   $0x76
  jmp __alltraps
c0102b52:	e9 c5 fb ff ff       	jmp    c010271c <__alltraps>

c0102b57 <vector119>:
.globl vector119
vector119:
  pushl $0
c0102b57:	6a 00                	push   $0x0
  pushl $119
c0102b59:	6a 77                	push   $0x77
  jmp __alltraps
c0102b5b:	e9 bc fb ff ff       	jmp    c010271c <__alltraps>

c0102b60 <vector120>:
.globl vector120
vector120:
  pushl $0
c0102b60:	6a 00                	push   $0x0
  pushl $120
c0102b62:	6a 78                	push   $0x78
  jmp __alltraps
c0102b64:	e9 b3 fb ff ff       	jmp    c010271c <__alltraps>

c0102b69 <vector121>:
.globl vector121
vector121:
  pushl $0
c0102b69:	6a 00                	push   $0x0
  pushl $121
c0102b6b:	6a 79                	push   $0x79
  jmp __alltraps
c0102b6d:	e9 aa fb ff ff       	jmp    c010271c <__alltraps>

c0102b72 <vector122>:
.globl vector122
vector122:
  pushl $0
c0102b72:	6a 00                	push   $0x0
  pushl $122
c0102b74:	6a 7a                	push   $0x7a
  jmp __alltraps
c0102b76:	e9 a1 fb ff ff       	jmp    c010271c <__alltraps>

c0102b7b <vector123>:
.globl vector123
vector123:
  pushl $0
c0102b7b:	6a 00                	push   $0x0
  pushl $123
c0102b7d:	6a 7b                	push   $0x7b
  jmp __alltraps
c0102b7f:	e9 98 fb ff ff       	jmp    c010271c <__alltraps>

c0102b84 <vector124>:
.globl vector124
vector124:
  pushl $0
c0102b84:	6a 00                	push   $0x0
  pushl $124
c0102b86:	6a 7c                	push   $0x7c
  jmp __alltraps
c0102b88:	e9 8f fb ff ff       	jmp    c010271c <__alltraps>

c0102b8d <vector125>:
.globl vector125
vector125:
  pushl $0
c0102b8d:	6a 00                	push   $0x0
  pushl $125
c0102b8f:	6a 7d                	push   $0x7d
  jmp __alltraps
c0102b91:	e9 86 fb ff ff       	jmp    c010271c <__alltraps>

c0102b96 <vector126>:
.globl vector126
vector126:
  pushl $0
c0102b96:	6a 00                	push   $0x0
  pushl $126
c0102b98:	6a 7e                	push   $0x7e
  jmp __alltraps
c0102b9a:	e9 7d fb ff ff       	jmp    c010271c <__alltraps>

c0102b9f <vector127>:
.globl vector127
vector127:
  pushl $0
c0102b9f:	6a 00                	push   $0x0
  pushl $127
c0102ba1:	6a 7f                	push   $0x7f
  jmp __alltraps
c0102ba3:	e9 74 fb ff ff       	jmp    c010271c <__alltraps>

c0102ba8 <vector128>:
.globl vector128
vector128:
  pushl $0
c0102ba8:	6a 00                	push   $0x0
  pushl $128
c0102baa:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c0102baf:	e9 68 fb ff ff       	jmp    c010271c <__alltraps>

c0102bb4 <vector129>:
.globl vector129
vector129:
  pushl $0
c0102bb4:	6a 00                	push   $0x0
  pushl $129
c0102bb6:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c0102bbb:	e9 5c fb ff ff       	jmp    c010271c <__alltraps>

c0102bc0 <vector130>:
.globl vector130
vector130:
  pushl $0
c0102bc0:	6a 00                	push   $0x0
  pushl $130
c0102bc2:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c0102bc7:	e9 50 fb ff ff       	jmp    c010271c <__alltraps>

c0102bcc <vector131>:
.globl vector131
vector131:
  pushl $0
c0102bcc:	6a 00                	push   $0x0
  pushl $131
c0102bce:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c0102bd3:	e9 44 fb ff ff       	jmp    c010271c <__alltraps>

c0102bd8 <vector132>:
.globl vector132
vector132:
  pushl $0
c0102bd8:	6a 00                	push   $0x0
  pushl $132
c0102bda:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c0102bdf:	e9 38 fb ff ff       	jmp    c010271c <__alltraps>

c0102be4 <vector133>:
.globl vector133
vector133:
  pushl $0
c0102be4:	6a 00                	push   $0x0
  pushl $133
c0102be6:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c0102beb:	e9 2c fb ff ff       	jmp    c010271c <__alltraps>

c0102bf0 <vector134>:
.globl vector134
vector134:
  pushl $0
c0102bf0:	6a 00                	push   $0x0
  pushl $134
c0102bf2:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c0102bf7:	e9 20 fb ff ff       	jmp    c010271c <__alltraps>

c0102bfc <vector135>:
.globl vector135
vector135:
  pushl $0
c0102bfc:	6a 00                	push   $0x0
  pushl $135
c0102bfe:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102c03:	e9 14 fb ff ff       	jmp    c010271c <__alltraps>

c0102c08 <vector136>:
.globl vector136
vector136:
  pushl $0
c0102c08:	6a 00                	push   $0x0
  pushl $136
c0102c0a:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c0102c0f:	e9 08 fb ff ff       	jmp    c010271c <__alltraps>

c0102c14 <vector137>:
.globl vector137
vector137:
  pushl $0
c0102c14:	6a 00                	push   $0x0
  pushl $137
c0102c16:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c0102c1b:	e9 fc fa ff ff       	jmp    c010271c <__alltraps>

c0102c20 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102c20:	6a 00                	push   $0x0
  pushl $138
c0102c22:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c0102c27:	e9 f0 fa ff ff       	jmp    c010271c <__alltraps>

c0102c2c <vector139>:
.globl vector139
vector139:
  pushl $0
c0102c2c:	6a 00                	push   $0x0
  pushl $139
c0102c2e:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102c33:	e9 e4 fa ff ff       	jmp    c010271c <__alltraps>

c0102c38 <vector140>:
.globl vector140
vector140:
  pushl $0
c0102c38:	6a 00                	push   $0x0
  pushl $140
c0102c3a:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c0102c3f:	e9 d8 fa ff ff       	jmp    c010271c <__alltraps>

c0102c44 <vector141>:
.globl vector141
vector141:
  pushl $0
c0102c44:	6a 00                	push   $0x0
  pushl $141
c0102c46:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c0102c4b:	e9 cc fa ff ff       	jmp    c010271c <__alltraps>

c0102c50 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102c50:	6a 00                	push   $0x0
  pushl $142
c0102c52:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c0102c57:	e9 c0 fa ff ff       	jmp    c010271c <__alltraps>

c0102c5c <vector143>:
.globl vector143
vector143:
  pushl $0
c0102c5c:	6a 00                	push   $0x0
  pushl $143
c0102c5e:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c0102c63:	e9 b4 fa ff ff       	jmp    c010271c <__alltraps>

c0102c68 <vector144>:
.globl vector144
vector144:
  pushl $0
c0102c68:	6a 00                	push   $0x0
  pushl $144
c0102c6a:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c0102c6f:	e9 a8 fa ff ff       	jmp    c010271c <__alltraps>

c0102c74 <vector145>:
.globl vector145
vector145:
  pushl $0
c0102c74:	6a 00                	push   $0x0
  pushl $145
c0102c76:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c0102c7b:	e9 9c fa ff ff       	jmp    c010271c <__alltraps>

c0102c80 <vector146>:
.globl vector146
vector146:
  pushl $0
c0102c80:	6a 00                	push   $0x0
  pushl $146
c0102c82:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c0102c87:	e9 90 fa ff ff       	jmp    c010271c <__alltraps>

c0102c8c <vector147>:
.globl vector147
vector147:
  pushl $0
c0102c8c:	6a 00                	push   $0x0
  pushl $147
c0102c8e:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c0102c93:	e9 84 fa ff ff       	jmp    c010271c <__alltraps>

c0102c98 <vector148>:
.globl vector148
vector148:
  pushl $0
c0102c98:	6a 00                	push   $0x0
  pushl $148
c0102c9a:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c0102c9f:	e9 78 fa ff ff       	jmp    c010271c <__alltraps>

c0102ca4 <vector149>:
.globl vector149
vector149:
  pushl $0
c0102ca4:	6a 00                	push   $0x0
  pushl $149
c0102ca6:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c0102cab:	e9 6c fa ff ff       	jmp    c010271c <__alltraps>

c0102cb0 <vector150>:
.globl vector150
vector150:
  pushl $0
c0102cb0:	6a 00                	push   $0x0
  pushl $150
c0102cb2:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c0102cb7:	e9 60 fa ff ff       	jmp    c010271c <__alltraps>

c0102cbc <vector151>:
.globl vector151
vector151:
  pushl $0
c0102cbc:	6a 00                	push   $0x0
  pushl $151
c0102cbe:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c0102cc3:	e9 54 fa ff ff       	jmp    c010271c <__alltraps>

c0102cc8 <vector152>:
.globl vector152
vector152:
  pushl $0
c0102cc8:	6a 00                	push   $0x0
  pushl $152
c0102cca:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c0102ccf:	e9 48 fa ff ff       	jmp    c010271c <__alltraps>

c0102cd4 <vector153>:
.globl vector153
vector153:
  pushl $0
c0102cd4:	6a 00                	push   $0x0
  pushl $153
c0102cd6:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c0102cdb:	e9 3c fa ff ff       	jmp    c010271c <__alltraps>

c0102ce0 <vector154>:
.globl vector154
vector154:
  pushl $0
c0102ce0:	6a 00                	push   $0x0
  pushl $154
c0102ce2:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c0102ce7:	e9 30 fa ff ff       	jmp    c010271c <__alltraps>

c0102cec <vector155>:
.globl vector155
vector155:
  pushl $0
c0102cec:	6a 00                	push   $0x0
  pushl $155
c0102cee:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c0102cf3:	e9 24 fa ff ff       	jmp    c010271c <__alltraps>

c0102cf8 <vector156>:
.globl vector156
vector156:
  pushl $0
c0102cf8:	6a 00                	push   $0x0
  pushl $156
c0102cfa:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c0102cff:	e9 18 fa ff ff       	jmp    c010271c <__alltraps>

c0102d04 <vector157>:
.globl vector157
vector157:
  pushl $0
c0102d04:	6a 00                	push   $0x0
  pushl $157
c0102d06:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c0102d0b:	e9 0c fa ff ff       	jmp    c010271c <__alltraps>

c0102d10 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102d10:	6a 00                	push   $0x0
  pushl $158
c0102d12:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c0102d17:	e9 00 fa ff ff       	jmp    c010271c <__alltraps>

c0102d1c <vector159>:
.globl vector159
vector159:
  pushl $0
c0102d1c:	6a 00                	push   $0x0
  pushl $159
c0102d1e:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102d23:	e9 f4 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d28 <vector160>:
.globl vector160
vector160:
  pushl $0
c0102d28:	6a 00                	push   $0x0
  pushl $160
c0102d2a:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c0102d2f:	e9 e8 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d34 <vector161>:
.globl vector161
vector161:
  pushl $0
c0102d34:	6a 00                	push   $0x0
  pushl $161
c0102d36:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c0102d3b:	e9 dc f9 ff ff       	jmp    c010271c <__alltraps>

c0102d40 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102d40:	6a 00                	push   $0x0
  pushl $162
c0102d42:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c0102d47:	e9 d0 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d4c <vector163>:
.globl vector163
vector163:
  pushl $0
c0102d4c:	6a 00                	push   $0x0
  pushl $163
c0102d4e:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102d53:	e9 c4 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d58 <vector164>:
.globl vector164
vector164:
  pushl $0
c0102d58:	6a 00                	push   $0x0
  pushl $164
c0102d5a:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c0102d5f:	e9 b8 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d64 <vector165>:
.globl vector165
vector165:
  pushl $0
c0102d64:	6a 00                	push   $0x0
  pushl $165
c0102d66:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c0102d6b:	e9 ac f9 ff ff       	jmp    c010271c <__alltraps>

c0102d70 <vector166>:
.globl vector166
vector166:
  pushl $0
c0102d70:	6a 00                	push   $0x0
  pushl $166
c0102d72:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c0102d77:	e9 a0 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d7c <vector167>:
.globl vector167
vector167:
  pushl $0
c0102d7c:	6a 00                	push   $0x0
  pushl $167
c0102d7e:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c0102d83:	e9 94 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d88 <vector168>:
.globl vector168
vector168:
  pushl $0
c0102d88:	6a 00                	push   $0x0
  pushl $168
c0102d8a:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c0102d8f:	e9 88 f9 ff ff       	jmp    c010271c <__alltraps>

c0102d94 <vector169>:
.globl vector169
vector169:
  pushl $0
c0102d94:	6a 00                	push   $0x0
  pushl $169
c0102d96:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c0102d9b:	e9 7c f9 ff ff       	jmp    c010271c <__alltraps>

c0102da0 <vector170>:
.globl vector170
vector170:
  pushl $0
c0102da0:	6a 00                	push   $0x0
  pushl $170
c0102da2:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c0102da7:	e9 70 f9 ff ff       	jmp    c010271c <__alltraps>

c0102dac <vector171>:
.globl vector171
vector171:
  pushl $0
c0102dac:	6a 00                	push   $0x0
  pushl $171
c0102dae:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c0102db3:	e9 64 f9 ff ff       	jmp    c010271c <__alltraps>

c0102db8 <vector172>:
.globl vector172
vector172:
  pushl $0
c0102db8:	6a 00                	push   $0x0
  pushl $172
c0102dba:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c0102dbf:	e9 58 f9 ff ff       	jmp    c010271c <__alltraps>

c0102dc4 <vector173>:
.globl vector173
vector173:
  pushl $0
c0102dc4:	6a 00                	push   $0x0
  pushl $173
c0102dc6:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c0102dcb:	e9 4c f9 ff ff       	jmp    c010271c <__alltraps>

c0102dd0 <vector174>:
.globl vector174
vector174:
  pushl $0
c0102dd0:	6a 00                	push   $0x0
  pushl $174
c0102dd2:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c0102dd7:	e9 40 f9 ff ff       	jmp    c010271c <__alltraps>

c0102ddc <vector175>:
.globl vector175
vector175:
  pushl $0
c0102ddc:	6a 00                	push   $0x0
  pushl $175
c0102dde:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c0102de3:	e9 34 f9 ff ff       	jmp    c010271c <__alltraps>

c0102de8 <vector176>:
.globl vector176
vector176:
  pushl $0
c0102de8:	6a 00                	push   $0x0
  pushl $176
c0102dea:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c0102def:	e9 28 f9 ff ff       	jmp    c010271c <__alltraps>

c0102df4 <vector177>:
.globl vector177
vector177:
  pushl $0
c0102df4:	6a 00                	push   $0x0
  pushl $177
c0102df6:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c0102dfb:	e9 1c f9 ff ff       	jmp    c010271c <__alltraps>

c0102e00 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102e00:	6a 00                	push   $0x0
  pushl $178
c0102e02:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c0102e07:	e9 10 f9 ff ff       	jmp    c010271c <__alltraps>

c0102e0c <vector179>:
.globl vector179
vector179:
  pushl $0
c0102e0c:	6a 00                	push   $0x0
  pushl $179
c0102e0e:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102e13:	e9 04 f9 ff ff       	jmp    c010271c <__alltraps>

c0102e18 <vector180>:
.globl vector180
vector180:
  pushl $0
c0102e18:	6a 00                	push   $0x0
  pushl $180
c0102e1a:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c0102e1f:	e9 f8 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e24 <vector181>:
.globl vector181
vector181:
  pushl $0
c0102e24:	6a 00                	push   $0x0
  pushl $181
c0102e26:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c0102e2b:	e9 ec f8 ff ff       	jmp    c010271c <__alltraps>

c0102e30 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102e30:	6a 00                	push   $0x0
  pushl $182
c0102e32:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c0102e37:	e9 e0 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e3c <vector183>:
.globl vector183
vector183:
  pushl $0
c0102e3c:	6a 00                	push   $0x0
  pushl $183
c0102e3e:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102e43:	e9 d4 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e48 <vector184>:
.globl vector184
vector184:
  pushl $0
c0102e48:	6a 00                	push   $0x0
  pushl $184
c0102e4a:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c0102e4f:	e9 c8 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e54 <vector185>:
.globl vector185
vector185:
  pushl $0
c0102e54:	6a 00                	push   $0x0
  pushl $185
c0102e56:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c0102e5b:	e9 bc f8 ff ff       	jmp    c010271c <__alltraps>

c0102e60 <vector186>:
.globl vector186
vector186:
  pushl $0
c0102e60:	6a 00                	push   $0x0
  pushl $186
c0102e62:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c0102e67:	e9 b0 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e6c <vector187>:
.globl vector187
vector187:
  pushl $0
c0102e6c:	6a 00                	push   $0x0
  pushl $187
c0102e6e:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c0102e73:	e9 a4 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e78 <vector188>:
.globl vector188
vector188:
  pushl $0
c0102e78:	6a 00                	push   $0x0
  pushl $188
c0102e7a:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c0102e7f:	e9 98 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e84 <vector189>:
.globl vector189
vector189:
  pushl $0
c0102e84:	6a 00                	push   $0x0
  pushl $189
c0102e86:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c0102e8b:	e9 8c f8 ff ff       	jmp    c010271c <__alltraps>

c0102e90 <vector190>:
.globl vector190
vector190:
  pushl $0
c0102e90:	6a 00                	push   $0x0
  pushl $190
c0102e92:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c0102e97:	e9 80 f8 ff ff       	jmp    c010271c <__alltraps>

c0102e9c <vector191>:
.globl vector191
vector191:
  pushl $0
c0102e9c:	6a 00                	push   $0x0
  pushl $191
c0102e9e:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c0102ea3:	e9 74 f8 ff ff       	jmp    c010271c <__alltraps>

c0102ea8 <vector192>:
.globl vector192
vector192:
  pushl $0
c0102ea8:	6a 00                	push   $0x0
  pushl $192
c0102eaa:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c0102eaf:	e9 68 f8 ff ff       	jmp    c010271c <__alltraps>

c0102eb4 <vector193>:
.globl vector193
vector193:
  pushl $0
c0102eb4:	6a 00                	push   $0x0
  pushl $193
c0102eb6:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c0102ebb:	e9 5c f8 ff ff       	jmp    c010271c <__alltraps>

c0102ec0 <vector194>:
.globl vector194
vector194:
  pushl $0
c0102ec0:	6a 00                	push   $0x0
  pushl $194
c0102ec2:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c0102ec7:	e9 50 f8 ff ff       	jmp    c010271c <__alltraps>

c0102ecc <vector195>:
.globl vector195
vector195:
  pushl $0
c0102ecc:	6a 00                	push   $0x0
  pushl $195
c0102ece:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c0102ed3:	e9 44 f8 ff ff       	jmp    c010271c <__alltraps>

c0102ed8 <vector196>:
.globl vector196
vector196:
  pushl $0
c0102ed8:	6a 00                	push   $0x0
  pushl $196
c0102eda:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c0102edf:	e9 38 f8 ff ff       	jmp    c010271c <__alltraps>

c0102ee4 <vector197>:
.globl vector197
vector197:
  pushl $0
c0102ee4:	6a 00                	push   $0x0
  pushl $197
c0102ee6:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c0102eeb:	e9 2c f8 ff ff       	jmp    c010271c <__alltraps>

c0102ef0 <vector198>:
.globl vector198
vector198:
  pushl $0
c0102ef0:	6a 00                	push   $0x0
  pushl $198
c0102ef2:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c0102ef7:	e9 20 f8 ff ff       	jmp    c010271c <__alltraps>

c0102efc <vector199>:
.globl vector199
vector199:
  pushl $0
c0102efc:	6a 00                	push   $0x0
  pushl $199
c0102efe:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102f03:	e9 14 f8 ff ff       	jmp    c010271c <__alltraps>

c0102f08 <vector200>:
.globl vector200
vector200:
  pushl $0
c0102f08:	6a 00                	push   $0x0
  pushl $200
c0102f0a:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102f0f:	e9 08 f8 ff ff       	jmp    c010271c <__alltraps>

c0102f14 <vector201>:
.globl vector201
vector201:
  pushl $0
c0102f14:	6a 00                	push   $0x0
  pushl $201
c0102f16:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c0102f1b:	e9 fc f7 ff ff       	jmp    c010271c <__alltraps>

c0102f20 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102f20:	6a 00                	push   $0x0
  pushl $202
c0102f22:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c0102f27:	e9 f0 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f2c <vector203>:
.globl vector203
vector203:
  pushl $0
c0102f2c:	6a 00                	push   $0x0
  pushl $203
c0102f2e:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102f33:	e9 e4 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f38 <vector204>:
.globl vector204
vector204:
  pushl $0
c0102f38:	6a 00                	push   $0x0
  pushl $204
c0102f3a:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102f3f:	e9 d8 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f44 <vector205>:
.globl vector205
vector205:
  pushl $0
c0102f44:	6a 00                	push   $0x0
  pushl $205
c0102f46:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c0102f4b:	e9 cc f7 ff ff       	jmp    c010271c <__alltraps>

c0102f50 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102f50:	6a 00                	push   $0x0
  pushl $206
c0102f52:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c0102f57:	e9 c0 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f5c <vector207>:
.globl vector207
vector207:
  pushl $0
c0102f5c:	6a 00                	push   $0x0
  pushl $207
c0102f5e:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c0102f63:	e9 b4 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f68 <vector208>:
.globl vector208
vector208:
  pushl $0
c0102f68:	6a 00                	push   $0x0
  pushl $208
c0102f6a:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c0102f6f:	e9 a8 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f74 <vector209>:
.globl vector209
vector209:
  pushl $0
c0102f74:	6a 00                	push   $0x0
  pushl $209
c0102f76:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c0102f7b:	e9 9c f7 ff ff       	jmp    c010271c <__alltraps>

c0102f80 <vector210>:
.globl vector210
vector210:
  pushl $0
c0102f80:	6a 00                	push   $0x0
  pushl $210
c0102f82:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c0102f87:	e9 90 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f8c <vector211>:
.globl vector211
vector211:
  pushl $0
c0102f8c:	6a 00                	push   $0x0
  pushl $211
c0102f8e:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c0102f93:	e9 84 f7 ff ff       	jmp    c010271c <__alltraps>

c0102f98 <vector212>:
.globl vector212
vector212:
  pushl $0
c0102f98:	6a 00                	push   $0x0
  pushl $212
c0102f9a:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c0102f9f:	e9 78 f7 ff ff       	jmp    c010271c <__alltraps>

c0102fa4 <vector213>:
.globl vector213
vector213:
  pushl $0
c0102fa4:	6a 00                	push   $0x0
  pushl $213
c0102fa6:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c0102fab:	e9 6c f7 ff ff       	jmp    c010271c <__alltraps>

c0102fb0 <vector214>:
.globl vector214
vector214:
  pushl $0
c0102fb0:	6a 00                	push   $0x0
  pushl $214
c0102fb2:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c0102fb7:	e9 60 f7 ff ff       	jmp    c010271c <__alltraps>

c0102fbc <vector215>:
.globl vector215
vector215:
  pushl $0
c0102fbc:	6a 00                	push   $0x0
  pushl $215
c0102fbe:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c0102fc3:	e9 54 f7 ff ff       	jmp    c010271c <__alltraps>

c0102fc8 <vector216>:
.globl vector216
vector216:
  pushl $0
c0102fc8:	6a 00                	push   $0x0
  pushl $216
c0102fca:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c0102fcf:	e9 48 f7 ff ff       	jmp    c010271c <__alltraps>

c0102fd4 <vector217>:
.globl vector217
vector217:
  pushl $0
c0102fd4:	6a 00                	push   $0x0
  pushl $217
c0102fd6:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c0102fdb:	e9 3c f7 ff ff       	jmp    c010271c <__alltraps>

c0102fe0 <vector218>:
.globl vector218
vector218:
  pushl $0
c0102fe0:	6a 00                	push   $0x0
  pushl $218
c0102fe2:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c0102fe7:	e9 30 f7 ff ff       	jmp    c010271c <__alltraps>

c0102fec <vector219>:
.globl vector219
vector219:
  pushl $0
c0102fec:	6a 00                	push   $0x0
  pushl $219
c0102fee:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c0102ff3:	e9 24 f7 ff ff       	jmp    c010271c <__alltraps>

c0102ff8 <vector220>:
.globl vector220
vector220:
  pushl $0
c0102ff8:	6a 00                	push   $0x0
  pushl $220
c0102ffa:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0102fff:	e9 18 f7 ff ff       	jmp    c010271c <__alltraps>

c0103004 <vector221>:
.globl vector221
vector221:
  pushl $0
c0103004:	6a 00                	push   $0x0
  pushl $221
c0103006:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c010300b:	e9 0c f7 ff ff       	jmp    c010271c <__alltraps>

c0103010 <vector222>:
.globl vector222
vector222:
  pushl $0
c0103010:	6a 00                	push   $0x0
  pushl $222
c0103012:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c0103017:	e9 00 f7 ff ff       	jmp    c010271c <__alltraps>

c010301c <vector223>:
.globl vector223
vector223:
  pushl $0
c010301c:	6a 00                	push   $0x0
  pushl $223
c010301e:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c0103023:	e9 f4 f6 ff ff       	jmp    c010271c <__alltraps>

c0103028 <vector224>:
.globl vector224
vector224:
  pushl $0
c0103028:	6a 00                	push   $0x0
  pushl $224
c010302a:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c010302f:	e9 e8 f6 ff ff       	jmp    c010271c <__alltraps>

c0103034 <vector225>:
.globl vector225
vector225:
  pushl $0
c0103034:	6a 00                	push   $0x0
  pushl $225
c0103036:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c010303b:	e9 dc f6 ff ff       	jmp    c010271c <__alltraps>

c0103040 <vector226>:
.globl vector226
vector226:
  pushl $0
c0103040:	6a 00                	push   $0x0
  pushl $226
c0103042:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c0103047:	e9 d0 f6 ff ff       	jmp    c010271c <__alltraps>

c010304c <vector227>:
.globl vector227
vector227:
  pushl $0
c010304c:	6a 00                	push   $0x0
  pushl $227
c010304e:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c0103053:	e9 c4 f6 ff ff       	jmp    c010271c <__alltraps>

c0103058 <vector228>:
.globl vector228
vector228:
  pushl $0
c0103058:	6a 00                	push   $0x0
  pushl $228
c010305a:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c010305f:	e9 b8 f6 ff ff       	jmp    c010271c <__alltraps>

c0103064 <vector229>:
.globl vector229
vector229:
  pushl $0
c0103064:	6a 00                	push   $0x0
  pushl $229
c0103066:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c010306b:	e9 ac f6 ff ff       	jmp    c010271c <__alltraps>

c0103070 <vector230>:
.globl vector230
vector230:
  pushl $0
c0103070:	6a 00                	push   $0x0
  pushl $230
c0103072:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c0103077:	e9 a0 f6 ff ff       	jmp    c010271c <__alltraps>

c010307c <vector231>:
.globl vector231
vector231:
  pushl $0
c010307c:	6a 00                	push   $0x0
  pushl $231
c010307e:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c0103083:	e9 94 f6 ff ff       	jmp    c010271c <__alltraps>

c0103088 <vector232>:
.globl vector232
vector232:
  pushl $0
c0103088:	6a 00                	push   $0x0
  pushl $232
c010308a:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c010308f:	e9 88 f6 ff ff       	jmp    c010271c <__alltraps>

c0103094 <vector233>:
.globl vector233
vector233:
  pushl $0
c0103094:	6a 00                	push   $0x0
  pushl $233
c0103096:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c010309b:	e9 7c f6 ff ff       	jmp    c010271c <__alltraps>

c01030a0 <vector234>:
.globl vector234
vector234:
  pushl $0
c01030a0:	6a 00                	push   $0x0
  pushl $234
c01030a2:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c01030a7:	e9 70 f6 ff ff       	jmp    c010271c <__alltraps>

c01030ac <vector235>:
.globl vector235
vector235:
  pushl $0
c01030ac:	6a 00                	push   $0x0
  pushl $235
c01030ae:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c01030b3:	e9 64 f6 ff ff       	jmp    c010271c <__alltraps>

c01030b8 <vector236>:
.globl vector236
vector236:
  pushl $0
c01030b8:	6a 00                	push   $0x0
  pushl $236
c01030ba:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c01030bf:	e9 58 f6 ff ff       	jmp    c010271c <__alltraps>

c01030c4 <vector237>:
.globl vector237
vector237:
  pushl $0
c01030c4:	6a 00                	push   $0x0
  pushl $237
c01030c6:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c01030cb:	e9 4c f6 ff ff       	jmp    c010271c <__alltraps>

c01030d0 <vector238>:
.globl vector238
vector238:
  pushl $0
c01030d0:	6a 00                	push   $0x0
  pushl $238
c01030d2:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c01030d7:	e9 40 f6 ff ff       	jmp    c010271c <__alltraps>

c01030dc <vector239>:
.globl vector239
vector239:
  pushl $0
c01030dc:	6a 00                	push   $0x0
  pushl $239
c01030de:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c01030e3:	e9 34 f6 ff ff       	jmp    c010271c <__alltraps>

c01030e8 <vector240>:
.globl vector240
vector240:
  pushl $0
c01030e8:	6a 00                	push   $0x0
  pushl $240
c01030ea:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c01030ef:	e9 28 f6 ff ff       	jmp    c010271c <__alltraps>

c01030f4 <vector241>:
.globl vector241
vector241:
  pushl $0
c01030f4:	6a 00                	push   $0x0
  pushl $241
c01030f6:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c01030fb:	e9 1c f6 ff ff       	jmp    c010271c <__alltraps>

c0103100 <vector242>:
.globl vector242
vector242:
  pushl $0
c0103100:	6a 00                	push   $0x0
  pushl $242
c0103102:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c0103107:	e9 10 f6 ff ff       	jmp    c010271c <__alltraps>

c010310c <vector243>:
.globl vector243
vector243:
  pushl $0
c010310c:	6a 00                	push   $0x0
  pushl $243
c010310e:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c0103113:	e9 04 f6 ff ff       	jmp    c010271c <__alltraps>

c0103118 <vector244>:
.globl vector244
vector244:
  pushl $0
c0103118:	6a 00                	push   $0x0
  pushl $244
c010311a:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c010311f:	e9 f8 f5 ff ff       	jmp    c010271c <__alltraps>

c0103124 <vector245>:
.globl vector245
vector245:
  pushl $0
c0103124:	6a 00                	push   $0x0
  pushl $245
c0103126:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c010312b:	e9 ec f5 ff ff       	jmp    c010271c <__alltraps>

c0103130 <vector246>:
.globl vector246
vector246:
  pushl $0
c0103130:	6a 00                	push   $0x0
  pushl $246
c0103132:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c0103137:	e9 e0 f5 ff ff       	jmp    c010271c <__alltraps>

c010313c <vector247>:
.globl vector247
vector247:
  pushl $0
c010313c:	6a 00                	push   $0x0
  pushl $247
c010313e:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c0103143:	e9 d4 f5 ff ff       	jmp    c010271c <__alltraps>

c0103148 <vector248>:
.globl vector248
vector248:
  pushl $0
c0103148:	6a 00                	push   $0x0
  pushl $248
c010314a:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c010314f:	e9 c8 f5 ff ff       	jmp    c010271c <__alltraps>

c0103154 <vector249>:
.globl vector249
vector249:
  pushl $0
c0103154:	6a 00                	push   $0x0
  pushl $249
c0103156:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c010315b:	e9 bc f5 ff ff       	jmp    c010271c <__alltraps>

c0103160 <vector250>:
.globl vector250
vector250:
  pushl $0
c0103160:	6a 00                	push   $0x0
  pushl $250
c0103162:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c0103167:	e9 b0 f5 ff ff       	jmp    c010271c <__alltraps>

c010316c <vector251>:
.globl vector251
vector251:
  pushl $0
c010316c:	6a 00                	push   $0x0
  pushl $251
c010316e:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c0103173:	e9 a4 f5 ff ff       	jmp    c010271c <__alltraps>

c0103178 <vector252>:
.globl vector252
vector252:
  pushl $0
c0103178:	6a 00                	push   $0x0
  pushl $252
c010317a:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c010317f:	e9 98 f5 ff ff       	jmp    c010271c <__alltraps>

c0103184 <vector253>:
.globl vector253
vector253:
  pushl $0
c0103184:	6a 00                	push   $0x0
  pushl $253
c0103186:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c010318b:	e9 8c f5 ff ff       	jmp    c010271c <__alltraps>

c0103190 <vector254>:
.globl vector254
vector254:
  pushl $0
c0103190:	6a 00                	push   $0x0
  pushl $254
c0103192:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c0103197:	e9 80 f5 ff ff       	jmp    c010271c <__alltraps>

c010319c <vector255>:
.globl vector255
vector255:
  pushl $0
c010319c:	6a 00                	push   $0x0
  pushl $255
c010319e:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c01031a3:	e9 74 f5 ff ff       	jmp    c010271c <__alltraps>

c01031a8 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c01031a8:	55                   	push   %ebp
c01031a9:	89 e5                	mov    %esp,%ebp
    return page - pages;
c01031ab:	8b 55 08             	mov    0x8(%ebp),%edx
c01031ae:	a1 d8 a9 11 c0       	mov    0xc011a9d8,%eax
c01031b3:	89 d1                	mov    %edx,%ecx
c01031b5:	29 c1                	sub    %eax,%ecx
c01031b7:	89 c8                	mov    %ecx,%eax
c01031b9:	c1 f8 04             	sar    $0x4,%eax
}
c01031bc:	5d                   	pop    %ebp
c01031bd:	c3                   	ret    

c01031be <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
c01031be:	55                   	push   %ebp
c01031bf:	89 e5                	mov    %esp,%ebp
c01031c1:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c01031c4:	8b 45 08             	mov    0x8(%ebp),%eax
c01031c7:	89 04 24             	mov    %eax,(%esp)
c01031ca:	e8 d9 ff ff ff       	call   c01031a8 <page2ppn>
c01031cf:	c1 e0 0c             	shl    $0xc,%eax
}
c01031d2:	c9                   	leave  
c01031d3:	c3                   	ret    

c01031d4 <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c01031d4:	55                   	push   %ebp
c01031d5:	89 e5                	mov    %esp,%ebp
c01031d7:	83 ec 10             	sub    $0x10,%esp
    return atomic_read(&(page->ref));
c01031da:	8b 45 08             	mov    0x8(%ebp),%eax
c01031dd:	89 45 fc             	mov    %eax,-0x4(%ebp)
 *
 * Atomically reads the value of @v.
 * */
static inline int
atomic_read(const atomic_t *v) {
    return v->counter;
c01031e0:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01031e3:	8b 00                	mov    (%eax),%eax
}
c01031e5:	c9                   	leave  
c01031e6:	c3                   	ret    

c01031e7 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c01031e7:	55                   	push   %ebp
c01031e8:	89 e5                	mov    %esp,%ebp
c01031ea:	83 ec 10             	sub    $0x10,%esp
    atomic_set(&(page->ref), val);
c01031ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01031f0:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01031f3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01031f6:	89 45 f8             	mov    %eax,-0x8(%ebp)
 *
 * Atomically sets the value of @v to @i.
 * */
static inline void
atomic_set(atomic_t *v, int i) {
    v->counter = i;
c01031f9:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01031fc:	8b 55 f8             	mov    -0x8(%ebp),%edx
c01031ff:	89 10                	mov    %edx,(%eax)
}
c0103201:	c9                   	leave  
c0103202:	c3                   	ret    

c0103203 <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
c0103203:	55                   	push   %ebp
c0103204:	89 e5                	mov    %esp,%ebp
c0103206:	83 ec 10             	sub    $0x10,%esp
c0103209:	c7 45 fc 20 a9 11 c0 	movl   $0xc011a920,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c0103210:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103213:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103216:	89 50 04             	mov    %edx,0x4(%eax)
c0103219:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010321c:	8b 50 04             	mov    0x4(%eax),%edx
c010321f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103222:	89 10                	mov    %edx,(%eax)
    list_init(&free_list);
    nr_free = 0;
c0103224:	c7 05 28 a9 11 c0 00 	movl   $0x0,0xc011a928
c010322b:	00 00 00 
}
c010322e:	c9                   	leave  
c010322f:	c3                   	ret    

c0103230 <default_init_memmap>:

static void
default_init_memmap(struct Page *base, size_t n) {
c0103230:	55                   	push   %ebp
c0103231:	89 e5                	mov    %esp,%ebp
c0103233:	83 ec 48             	sub    $0x48,%esp
    struct Page *p = base;
c0103236:	8b 45 08             	mov    0x8(%ebp),%eax
c0103239:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (; p != base + n; p ++) {
c010323c:	e9 c6 00 00 00       	jmp    c0103307 <default_init_memmap+0xd7>
        assert(PageReserved(p));
c0103241:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0103244:	83 c0 04             	add    $0x4,%eax
c0103247:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
c010324e:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103251:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0103254:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0103257:	0f a3 10             	bt     %edx,(%eax)
c010325a:	19 c0                	sbb    %eax,%eax
c010325c:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
c010325f:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0103263:	0f 95 c0             	setne  %al
c0103266:	0f b6 c0             	movzbl %al,%eax
c0103269:	85 c0                	test   %eax,%eax
c010326b:	75 24                	jne    c0103291 <default_init_memmap+0x61>
c010326d:	c7 44 24 0c 70 6c 10 	movl   $0xc0106c70,0xc(%esp)
c0103274:	c0 
c0103275:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010327c:	c0 
c010327d:	c7 44 24 04 15 00 00 	movl   $0x15,0x4(%esp)
c0103284:	00 
c0103285:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010328c:	e8 ff e3 ff ff       	call   c0101690 <__panic>
        p->flags = 0;
c0103291:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0103294:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);
c010329b:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01032a2:	00 
c01032a3:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01032a6:	89 04 24             	mov    %eax,(%esp)
c01032a9:	e8 39 ff ff ff       	call   c01031e7 <set_page_ref>
        list_add(&free_list, &(p->page_link));
c01032ae:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01032b1:	83 c0 08             	add    $0x8,%eax
c01032b4:	c7 45 e0 20 a9 11 c0 	movl   $0xc011a920,-0x20(%ebp)
c01032bb:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01032be:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01032c1:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01032c4:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01032c7:	89 45 e4             	mov    %eax,-0x1c(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm, listelm->next);
c01032ca:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01032cd:	8b 40 04             	mov    0x4(%eax),%eax
c01032d0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01032d3:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01032d6:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01032d9:	89 55 f0             	mov    %edx,-0x10(%ebp)
c01032dc:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c01032df:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01032e2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01032e5:	89 10                	mov    %edx,(%eax)
c01032e7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01032ea:	8b 10                	mov    (%eax),%edx
c01032ec:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01032ef:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01032f2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032f5:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01032f8:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c01032fb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032fe:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103301:	89 10                	mov    %edx,(%eax)
}

static void
default_init_memmap(struct Page *base, size_t n) {
    struct Page *p = base;
    for (; p != base + n; p ++) {
c0103303:	83 45 cc 10          	addl   $0x10,-0x34(%ebp)
c0103307:	8b 45 0c             	mov    0xc(%ebp),%eax
c010330a:	c1 e0 04             	shl    $0x4,%eax
c010330d:	03 45 08             	add    0x8(%ebp),%eax
c0103310:	3b 45 cc             	cmp    -0x34(%ebp),%eax
c0103313:	0f 85 28 ff ff ff    	jne    c0103241 <default_init_memmap+0x11>
        assert(PageReserved(p));
        p->flags = 0;
        set_page_ref(p, 0);
        list_add(&free_list, &(p->page_link));
    }
    nr_free += n;
c0103319:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c010331e:	03 45 0c             	add    0xc(%ebp),%eax
c0103321:	a3 28 a9 11 c0       	mov    %eax,0xc011a928
}
c0103326:	c9                   	leave  
c0103327:	c3                   	ret    

c0103328 <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
c0103328:	55                   	push   %ebp
c0103329:	89 e5                	mov    %esp,%ebp
c010332b:	83 ec 38             	sub    $0x38,%esp
    assert(n == 1);
c010332e:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c0103332:	74 24                	je     c0103358 <default_alloc_pages+0x30>
c0103334:	c7 44 24 0c ab 6c 10 	movl   $0xc0106cab,0xc(%esp)
c010333b:	c0 
c010333c:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103343:	c0 
c0103344:	c7 44 24 04 1f 00 00 	movl   $0x1f,0x4(%esp)
c010334b:	00 
c010334c:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103353:	e8 38 e3 ff ff       	call   c0101690 <__panic>
c0103358:	c7 45 e8 20 a9 11 c0 	movl   $0xc011a920,-0x18(%ebp)
 * list_next - get the next entry
 * @listelm:    the list head
 **/
static list_entry_t *
list_next(list_entry_t *listelm) {
    return listelm->next;
c010335f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103362:	8b 40 04             	mov    0x4(%eax),%eax
    list_entry_t *le;
    if ((le = list_next(&free_list)) != &free_list) {
c0103365:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0103368:	81 7d e4 20 a9 11 c0 	cmpl   $0xc011a920,-0x1c(%ebp)
c010336f:	74 3d                	je     c01033ae <default_alloc_pages+0x86>
        nr_free --;
c0103371:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c0103376:	83 e8 01             	sub    $0x1,%eax
c0103379:	a3 28 a9 11 c0       	mov    %eax,0xc011a928
c010337e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103381:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * Note: list_empty() on @listelm does not return true after this, the entry is
 * in an undefined state.
 * */
static inline void
list_del(list_entry_t *listelm) {
    __list_del(listelm->prev, listelm->next);
c0103384:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103387:	8b 40 04             	mov    0x4(%eax),%eax
c010338a:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010338d:	8b 12                	mov    (%edx),%edx
c010338f:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0103392:	89 45 f0             	mov    %eax,-0x10(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
c0103395:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103398:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010339b:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010339e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01033a1:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01033a4:	89 10                	mov    %edx,(%eax)
        list_del(le);
        return le2page(le, page_link);
c01033a6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01033a9:	83 e8 08             	sub    $0x8,%eax
c01033ac:	eb 05                	jmp    c01033b3 <default_alloc_pages+0x8b>
    }
    return NULL;
c01033ae:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01033b3:	c9                   	leave  
c01033b4:	c3                   	ret    

c01033b5 <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
c01033b5:	55                   	push   %ebp
c01033b6:	89 e5                	mov    %esp,%ebp
c01033b8:	83 ec 48             	sub    $0x48,%esp
    assert(n == 1 && !PageReserved(base));
c01033bb:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c01033bf:	75 2c                	jne    c01033ed <default_free_pages+0x38>
c01033c1:	8b 45 08             	mov    0x8(%ebp),%eax
c01033c4:	83 c0 04             	add    $0x4,%eax
c01033c7:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
c01033ce:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01033d1:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01033d4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01033d7:	0f a3 10             	bt     %edx,(%eax)
c01033da:	19 c0                	sbb    %eax,%eax
c01033dc:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
c01033df:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c01033e3:	0f 95 c0             	setne  %al
c01033e6:	0f b6 c0             	movzbl %al,%eax
c01033e9:	85 c0                	test   %eax,%eax
c01033eb:	74 24                	je     c0103411 <default_free_pages+0x5c>
c01033ed:	c7 44 24 0c b2 6c 10 	movl   $0xc0106cb2,0xc(%esp)
c01033f4:	c0 
c01033f5:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01033fc:	c0 
c01033fd:	c7 44 24 04 2b 00 00 	movl   $0x2b,0x4(%esp)
c0103404:	00 
c0103405:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010340c:	e8 7f e2 ff ff       	call   c0101690 <__panic>
    base->flags = 0;
c0103411:	8b 45 08             	mov    0x8(%ebp),%eax
c0103414:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    set_page_ref(base, 0);
c010341b:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0103422:	00 
c0103423:	8b 45 08             	mov    0x8(%ebp),%eax
c0103426:	89 04 24             	mov    %eax,(%esp)
c0103429:	e8 b9 fd ff ff       	call   c01031e7 <set_page_ref>
    nr_free ++;
c010342e:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c0103433:	83 c0 01             	add    $0x1,%eax
c0103436:	a3 28 a9 11 c0       	mov    %eax,0xc011a928
    list_add(&free_list, &(base->page_link));
c010343b:	8b 45 08             	mov    0x8(%ebp),%eax
c010343e:	83 c0 08             	add    $0x8,%eax
c0103441:	c7 45 e0 20 a9 11 c0 	movl   $0xc011a920,-0x20(%ebp)
c0103448:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010344b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010344e:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103451:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103454:	89 45 e4             	mov    %eax,-0x1c(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm, listelm->next);
c0103457:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010345a:	8b 40 04             	mov    0x4(%eax),%eax
c010345d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0103460:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0103463:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0103466:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0103469:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c010346c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010346f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0103472:	89 10                	mov    %edx,(%eax)
c0103474:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103477:	8b 10                	mov    (%eax),%edx
c0103479:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010347c:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c010347f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103482:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0103485:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0103488:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010348b:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010348e:	89 10                	mov    %edx,(%eax)
}
c0103490:	c9                   	leave  
c0103491:	c3                   	ret    

c0103492 <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
c0103492:	55                   	push   %ebp
c0103493:	89 e5                	mov    %esp,%ebp
    return nr_free;
c0103495:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
}
c010349a:	5d                   	pop    %ebp
c010349b:	c3                   	ret    

c010349c <basic_check>:

static void
basic_check(void) {
c010349c:	55                   	push   %ebp
c010349d:	89 e5                	mov    %esp,%ebp
c010349f:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c01034a2:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c01034a9:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01034ac:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01034af:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01034b2:	89 45 d8             	mov    %eax,-0x28(%ebp)
    assert((p0 = alloc_page()) != NULL);
c01034b5:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01034bc:	e8 89 08 00 00       	call   c0103d4a <alloc_pages>
c01034c1:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01034c4:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c01034c8:	75 24                	jne    c01034ee <basic_check+0x52>
c01034ca:	c7 44 24 0c d0 6c 10 	movl   $0xc0106cd0,0xc(%esp)
c01034d1:	c0 
c01034d2:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01034d9:	c0 
c01034da:	c7 44 24 04 3b 00 00 	movl   $0x3b,0x4(%esp)
c01034e1:	00 
c01034e2:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c01034e9:	e8 a2 e1 ff ff       	call   c0101690 <__panic>
    assert((p1 = alloc_page()) != NULL);
c01034ee:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01034f5:	e8 50 08 00 00       	call   c0103d4a <alloc_pages>
c01034fa:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01034fd:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0103501:	75 24                	jne    c0103527 <basic_check+0x8b>
c0103503:	c7 44 24 0c ec 6c 10 	movl   $0xc0106cec,0xc(%esp)
c010350a:	c0 
c010350b:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103512:	c0 
c0103513:	c7 44 24 04 3c 00 00 	movl   $0x3c,0x4(%esp)
c010351a:	00 
c010351b:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103522:	e8 69 e1 ff ff       	call   c0101690 <__panic>
    assert((p2 = alloc_page()) != NULL);
c0103527:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010352e:	e8 17 08 00 00       	call   c0103d4a <alloc_pages>
c0103533:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103536:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010353a:	75 24                	jne    c0103560 <basic_check+0xc4>
c010353c:	c7 44 24 0c 08 6d 10 	movl   $0xc0106d08,0xc(%esp)
c0103543:	c0 
c0103544:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010354b:	c0 
c010354c:	c7 44 24 04 3d 00 00 	movl   $0x3d,0x4(%esp)
c0103553:	00 
c0103554:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010355b:	e8 30 e1 ff ff       	call   c0101690 <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
c0103560:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103563:	3b 45 dc             	cmp    -0x24(%ebp),%eax
c0103566:	74 10                	je     c0103578 <basic_check+0xdc>
c0103568:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010356b:	3b 45 e0             	cmp    -0x20(%ebp),%eax
c010356e:	74 08                	je     c0103578 <basic_check+0xdc>
c0103570:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103573:	3b 45 e0             	cmp    -0x20(%ebp),%eax
c0103576:	75 24                	jne    c010359c <basic_check+0x100>
c0103578:	c7 44 24 0c 24 6d 10 	movl   $0xc0106d24,0xc(%esp)
c010357f:	c0 
c0103580:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103587:	c0 
c0103588:	c7 44 24 04 3f 00 00 	movl   $0x3f,0x4(%esp)
c010358f:	00 
c0103590:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103597:	e8 f4 e0 ff ff       	call   c0101690 <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p1) == 0);
c010359c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010359f:	89 04 24             	mov    %eax,(%esp)
c01035a2:	e8 2d fc ff ff       	call   c01031d4 <page_ref>
c01035a7:	85 c0                	test   %eax,%eax
c01035a9:	75 1e                	jne    c01035c9 <basic_check+0x12d>
c01035ab:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01035ae:	89 04 24             	mov    %eax,(%esp)
c01035b1:	e8 1e fc ff ff       	call   c01031d4 <page_ref>
c01035b6:	85 c0                	test   %eax,%eax
c01035b8:	75 0f                	jne    c01035c9 <basic_check+0x12d>
c01035ba:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01035bd:	89 04 24             	mov    %eax,(%esp)
c01035c0:	e8 0f fc ff ff       	call   c01031d4 <page_ref>
c01035c5:	85 c0                	test   %eax,%eax
c01035c7:	74 24                	je     c01035ed <basic_check+0x151>
c01035c9:	c7 44 24 0c 48 6d 10 	movl   $0xc0106d48,0xc(%esp)
c01035d0:	c0 
c01035d1:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01035d8:	c0 
c01035d9:	c7 44 24 04 40 00 00 	movl   $0x40,0x4(%esp)
c01035e0:	00 
c01035e1:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c01035e8:	e8 a3 e0 ff ff       	call   c0101690 <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
c01035ed:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01035f0:	89 04 24             	mov    %eax,(%esp)
c01035f3:	e8 c6 fb ff ff       	call   c01031be <page2pa>
c01035f8:	8b 15 40 a9 11 c0    	mov    0xc011a940,%edx
c01035fe:	c1 e2 0c             	shl    $0xc,%edx
c0103601:	39 d0                	cmp    %edx,%eax
c0103603:	72 24                	jb     c0103629 <basic_check+0x18d>
c0103605:	c7 44 24 0c 84 6d 10 	movl   $0xc0106d84,0xc(%esp)
c010360c:	c0 
c010360d:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103614:	c0 
c0103615:	c7 44 24 04 42 00 00 	movl   $0x42,0x4(%esp)
c010361c:	00 
c010361d:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103624:	e8 67 e0 ff ff       	call   c0101690 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
c0103629:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010362c:	89 04 24             	mov    %eax,(%esp)
c010362f:	e8 8a fb ff ff       	call   c01031be <page2pa>
c0103634:	8b 15 40 a9 11 c0    	mov    0xc011a940,%edx
c010363a:	c1 e2 0c             	shl    $0xc,%edx
c010363d:	39 d0                	cmp    %edx,%eax
c010363f:	72 24                	jb     c0103665 <basic_check+0x1c9>
c0103641:	c7 44 24 0c a1 6d 10 	movl   $0xc0106da1,0xc(%esp)
c0103648:	c0 
c0103649:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103650:	c0 
c0103651:	c7 44 24 04 43 00 00 	movl   $0x43,0x4(%esp)
c0103658:	00 
c0103659:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103660:	e8 2b e0 ff ff       	call   c0101690 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
c0103665:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103668:	89 04 24             	mov    %eax,(%esp)
c010366b:	e8 4e fb ff ff       	call   c01031be <page2pa>
c0103670:	8b 15 40 a9 11 c0    	mov    0xc011a940,%edx
c0103676:	c1 e2 0c             	shl    $0xc,%edx
c0103679:	39 d0                	cmp    %edx,%eax
c010367b:	72 24                	jb     c01036a1 <basic_check+0x205>
c010367d:	c7 44 24 0c be 6d 10 	movl   $0xc0106dbe,0xc(%esp)
c0103684:	c0 
c0103685:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010368c:	c0 
c010368d:	c7 44 24 04 44 00 00 	movl   $0x44,0x4(%esp)
c0103694:	00 
c0103695:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010369c:	e8 ef df ff ff       	call   c0101690 <__panic>

    list_entry_t free_list_store = free_list;
c01036a1:	a1 20 a9 11 c0       	mov    0xc011a920,%eax
c01036a6:	8b 15 24 a9 11 c0    	mov    0xc011a924,%edx
c01036ac:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01036af:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c01036b2:	c7 45 ec 20 a9 11 c0 	movl   $0xc011a920,-0x14(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c01036b9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01036bc:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01036bf:	89 50 04             	mov    %edx,0x4(%eax)
c01036c2:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01036c5:	8b 50 04             	mov    0x4(%eax),%edx
c01036c8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01036cb:	89 10                	mov    %edx,(%eax)
c01036cd:	c7 45 f0 20 a9 11 c0 	movl   $0xc011a920,-0x10(%ebp)
 * list_empty - tests whether a list is empty
 * @list:       the list to test.
 * */
static inline bool
list_empty(list_entry_t *list) {
    return list->next == list;
c01036d4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01036d7:	8b 40 04             	mov    0x4(%eax),%eax
c01036da:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c01036dd:	0f 94 c0             	sete   %al
c01036e0:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c01036e3:	85 c0                	test   %eax,%eax
c01036e5:	75 24                	jne    c010370b <basic_check+0x26f>
c01036e7:	c7 44 24 0c db 6d 10 	movl   $0xc0106ddb,0xc(%esp)
c01036ee:	c0 
c01036ef:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01036f6:	c0 
c01036f7:	c7 44 24 04 48 00 00 	movl   $0x48,0x4(%esp)
c01036fe:	00 
c01036ff:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103706:	e8 85 df ff ff       	call   c0101690 <__panic>

    unsigned int nr_free_store = nr_free;
c010370b:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c0103710:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;
c0103713:	c7 05 28 a9 11 c0 00 	movl   $0x0,0xc011a928
c010371a:	00 00 00 

    assert(alloc_page() == NULL);
c010371d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103724:	e8 21 06 00 00       	call   c0103d4a <alloc_pages>
c0103729:	85 c0                	test   %eax,%eax
c010372b:	74 24                	je     c0103751 <basic_check+0x2b5>
c010372d:	c7 44 24 0c f2 6d 10 	movl   $0xc0106df2,0xc(%esp)
c0103734:	c0 
c0103735:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010373c:	c0 
c010373d:	c7 44 24 04 4d 00 00 	movl   $0x4d,0x4(%esp)
c0103744:	00 
c0103745:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010374c:	e8 3f df ff ff       	call   c0101690 <__panic>

    free_page(p0);
c0103751:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103758:	00 
c0103759:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010375c:	89 04 24             	mov    %eax,(%esp)
c010375f:	e8 17 06 00 00       	call   c0103d7b <free_pages>
    free_page(p1);
c0103764:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010376b:	00 
c010376c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010376f:	89 04 24             	mov    %eax,(%esp)
c0103772:	e8 04 06 00 00       	call   c0103d7b <free_pages>
    free_page(p2);
c0103777:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010377e:	00 
c010377f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103782:	89 04 24             	mov    %eax,(%esp)
c0103785:	e8 f1 05 00 00       	call   c0103d7b <free_pages>
    assert(nr_free == 3);
c010378a:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c010378f:	83 f8 03             	cmp    $0x3,%eax
c0103792:	74 24                	je     c01037b8 <basic_check+0x31c>
c0103794:	c7 44 24 0c 07 6e 10 	movl   $0xc0106e07,0xc(%esp)
c010379b:	c0 
c010379c:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01037a3:	c0 
c01037a4:	c7 44 24 04 52 00 00 	movl   $0x52,0x4(%esp)
c01037ab:	00 
c01037ac:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c01037b3:	e8 d8 de ff ff       	call   c0101690 <__panic>

    assert((p0 = alloc_page()) != NULL);
c01037b8:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01037bf:	e8 86 05 00 00       	call   c0103d4a <alloc_pages>
c01037c4:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01037c7:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c01037cb:	75 24                	jne    c01037f1 <basic_check+0x355>
c01037cd:	c7 44 24 0c d0 6c 10 	movl   $0xc0106cd0,0xc(%esp)
c01037d4:	c0 
c01037d5:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01037dc:	c0 
c01037dd:	c7 44 24 04 54 00 00 	movl   $0x54,0x4(%esp)
c01037e4:	00 
c01037e5:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c01037ec:	e8 9f de ff ff       	call   c0101690 <__panic>
    assert((p1 = alloc_page()) != NULL);
c01037f1:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01037f8:	e8 4d 05 00 00       	call   c0103d4a <alloc_pages>
c01037fd:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0103800:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0103804:	75 24                	jne    c010382a <basic_check+0x38e>
c0103806:	c7 44 24 0c ec 6c 10 	movl   $0xc0106cec,0xc(%esp)
c010380d:	c0 
c010380e:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103815:	c0 
c0103816:	c7 44 24 04 55 00 00 	movl   $0x55,0x4(%esp)
c010381d:	00 
c010381e:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103825:	e8 66 de ff ff       	call   c0101690 <__panic>
    assert((p2 = alloc_page()) != NULL);
c010382a:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103831:	e8 14 05 00 00       	call   c0103d4a <alloc_pages>
c0103836:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103839:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010383d:	75 24                	jne    c0103863 <basic_check+0x3c7>
c010383f:	c7 44 24 0c 08 6d 10 	movl   $0xc0106d08,0xc(%esp)
c0103846:	c0 
c0103847:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010384e:	c0 
c010384f:	c7 44 24 04 56 00 00 	movl   $0x56,0x4(%esp)
c0103856:	00 
c0103857:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010385e:	e8 2d de ff ff       	call   c0101690 <__panic>

    assert(alloc_page() == NULL);
c0103863:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010386a:	e8 db 04 00 00       	call   c0103d4a <alloc_pages>
c010386f:	85 c0                	test   %eax,%eax
c0103871:	74 24                	je     c0103897 <basic_check+0x3fb>
c0103873:	c7 44 24 0c f2 6d 10 	movl   $0xc0106df2,0xc(%esp)
c010387a:	c0 
c010387b:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103882:	c0 
c0103883:	c7 44 24 04 58 00 00 	movl   $0x58,0x4(%esp)
c010388a:	00 
c010388b:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103892:	e8 f9 dd ff ff       	call   c0101690 <__panic>

    free_page(p0);
c0103897:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010389e:	00 
c010389f:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01038a2:	89 04 24             	mov    %eax,(%esp)
c01038a5:	e8 d1 04 00 00       	call   c0103d7b <free_pages>
c01038aa:	c7 45 f4 20 a9 11 c0 	movl   $0xc011a920,-0xc(%ebp)
c01038b1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01038b4:	8b 40 04             	mov    0x4(%eax),%eax
c01038b7:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01038ba:	0f 94 c0             	sete   %al
c01038bd:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
c01038c0:	85 c0                	test   %eax,%eax
c01038c2:	74 24                	je     c01038e8 <basic_check+0x44c>
c01038c4:	c7 44 24 0c 14 6e 10 	movl   $0xc0106e14,0xc(%esp)
c01038cb:	c0 
c01038cc:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c01038d3:	c0 
c01038d4:	c7 44 24 04 5b 00 00 	movl   $0x5b,0x4(%esp)
c01038db:	00 
c01038dc:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c01038e3:	e8 a8 dd ff ff       	call   c0101690 <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
c01038e8:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01038ef:	e8 56 04 00 00       	call   c0103d4a <alloc_pages>
c01038f4:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01038f7:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038fa:	3b 45 d8             	cmp    -0x28(%ebp),%eax
c01038fd:	74 24                	je     c0103923 <basic_check+0x487>
c01038ff:	c7 44 24 0c 2c 6e 10 	movl   $0xc0106e2c,0xc(%esp)
c0103906:	c0 
c0103907:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010390e:	c0 
c010390f:	c7 44 24 04 5e 00 00 	movl   $0x5e,0x4(%esp)
c0103916:	00 
c0103917:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010391e:	e8 6d dd ff ff       	call   c0101690 <__panic>
    assert(alloc_page() == NULL);
c0103923:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010392a:	e8 1b 04 00 00       	call   c0103d4a <alloc_pages>
c010392f:	85 c0                	test   %eax,%eax
c0103931:	74 24                	je     c0103957 <basic_check+0x4bb>
c0103933:	c7 44 24 0c f2 6d 10 	movl   $0xc0106df2,0xc(%esp)
c010393a:	c0 
c010393b:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c0103942:	c0 
c0103943:	c7 44 24 04 5f 00 00 	movl   $0x5f,0x4(%esp)
c010394a:	00 
c010394b:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c0103952:	e8 39 dd ff ff       	call   c0101690 <__panic>

    assert(nr_free == 0);
c0103957:	a1 28 a9 11 c0       	mov    0xc011a928,%eax
c010395c:	85 c0                	test   %eax,%eax
c010395e:	74 24                	je     c0103984 <basic_check+0x4e8>
c0103960:	c7 44 24 0c 45 6e 10 	movl   $0xc0106e45,0xc(%esp)
c0103967:	c0 
c0103968:	c7 44 24 08 80 6c 10 	movl   $0xc0106c80,0x8(%esp)
c010396f:	c0 
c0103970:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0103977:	00 
c0103978:	c7 04 24 95 6c 10 c0 	movl   $0xc0106c95,(%esp)
c010397f:	e8 0c dd ff ff       	call   c0101690 <__panic>
    free_list = free_list_store;
c0103984:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0103987:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010398a:	a3 20 a9 11 c0       	mov    %eax,0xc011a920
c010398f:	89 15 24 a9 11 c0    	mov    %edx,0xc011a924
    nr_free = nr_free_store;
c0103995:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103998:	a3 28 a9 11 c0       	mov    %eax,0xc011a928

    free_page(p);
c010399d:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01039a4:	00 
c01039a5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039a8:	89 04 24             	mov    %eax,(%esp)
c01039ab:	e8 cb 03 00 00       	call   c0103d7b <free_pages>
    free_page(p1);
c01039b0:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01039b7:	00 
c01039b8:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01039bb:	89 04 24             	mov    %eax,(%esp)
c01039be:	e8 b8 03 00 00       	call   c0103d7b <free_pages>
    free_page(p2);
c01039c3:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01039ca:	00 
c01039cb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01039ce:	89 04 24             	mov    %eax,(%esp)
c01039d1:	e8 a5 03 00 00       	call   c0103d7b <free_pages>
}
c01039d6:	c9                   	leave  
c01039d7:	c3                   	ret    

c01039d8 <default_check>:

static void
default_check(void) {
c01039d8:	55                   	push   %ebp
c01039d9:	89 e5                	mov    %esp,%ebp
c01039db:	83 ec 08             	sub    $0x8,%esp
    basic_check();
c01039de:	e8 b9 fa ff ff       	call   c010349c <basic_check>
}
c01039e3:	c9                   	leave  
c01039e4:	c3                   	ret    
c01039e5:	00 00                	add    %al,(%eax)
	...

c01039e8 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c01039e8:	55                   	push   %ebp
c01039e9:	89 e5                	mov    %esp,%ebp
    return page - pages;
c01039eb:	8b 55 08             	mov    0x8(%ebp),%edx
c01039ee:	a1 d8 a9 11 c0       	mov    0xc011a9d8,%eax
c01039f3:	89 d1                	mov    %edx,%ecx
c01039f5:	29 c1                	sub    %eax,%ecx
c01039f7:	89 c8                	mov    %ecx,%eax
c01039f9:	c1 f8 04             	sar    $0x4,%eax
}
c01039fc:	5d                   	pop    %ebp
c01039fd:	c3                   	ret    

c01039fe <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
c01039fe:	55                   	push   %ebp
c01039ff:	89 e5                	mov    %esp,%ebp
c0103a01:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0103a04:	8b 45 08             	mov    0x8(%ebp),%eax
c0103a07:	89 04 24             	mov    %eax,(%esp)
c0103a0a:	e8 d9 ff ff ff       	call   c01039e8 <page2ppn>
c0103a0f:	c1 e0 0c             	shl    $0xc,%eax
}
c0103a12:	c9                   	leave  
c0103a13:	c3                   	ret    

c0103a14 <pa2page>:

static inline struct Page *
pa2page(uintptr_t pa) {
c0103a14:	55                   	push   %ebp
c0103a15:	89 e5                	mov    %esp,%ebp
c0103a17:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
c0103a1a:	8b 45 08             	mov    0x8(%ebp),%eax
c0103a1d:	89 c2                	mov    %eax,%edx
c0103a1f:	c1 ea 0c             	shr    $0xc,%edx
c0103a22:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0103a27:	39 c2                	cmp    %eax,%edx
c0103a29:	72 1c                	jb     c0103a47 <pa2page+0x33>
        panic("pa2page called with invalid pa");
c0103a2b:	c7 44 24 08 84 6e 10 	movl   $0xc0106e84,0x8(%esp)
c0103a32:	c0 
c0103a33:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
c0103a3a:	00 
c0103a3b:	c7 04 24 a3 6e 10 c0 	movl   $0xc0106ea3,(%esp)
c0103a42:	e8 49 dc ff ff       	call   c0101690 <__panic>
    }
    return &pages[PPN(pa)];
c0103a47:	a1 d8 a9 11 c0       	mov    0xc011a9d8,%eax
c0103a4c:	8b 55 08             	mov    0x8(%ebp),%edx
c0103a4f:	c1 ea 0c             	shr    $0xc,%edx
c0103a52:	c1 e2 04             	shl    $0x4,%edx
c0103a55:	01 d0                	add    %edx,%eax
}
c0103a57:	c9                   	leave  
c0103a58:	c3                   	ret    

c0103a59 <page2kva>:

static inline void *
page2kva(struct Page *page) {
c0103a59:	55                   	push   %ebp
c0103a5a:	89 e5                	mov    %esp,%ebp
c0103a5c:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
c0103a5f:	8b 45 08             	mov    0x8(%ebp),%eax
c0103a62:	89 04 24             	mov    %eax,(%esp)
c0103a65:	e8 94 ff ff ff       	call   c01039fe <page2pa>
c0103a6a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103a6d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103a70:	c1 e8 0c             	shr    $0xc,%eax
c0103a73:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0103a76:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0103a7b:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0103a7e:	72 23                	jb     c0103aa3 <page2kva+0x4a>
c0103a80:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103a83:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103a87:	c7 44 24 08 b4 6e 10 	movl   $0xc0106eb4,0x8(%esp)
c0103a8e:	c0 
c0103a8f:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0103a96:	00 
c0103a97:	c7 04 24 a3 6e 10 c0 	movl   $0xc0106ea3,(%esp)
c0103a9e:	e8 ed db ff ff       	call   c0101690 <__panic>
c0103aa3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103aa6:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c0103aab:	c9                   	leave  
c0103aac:	c3                   	ret    

c0103aad <pte2page>:
kva2page(void *kva) {
    return pa2page(PADDR(kva));
}

static inline struct Page *
pte2page(pte_t pte) {
c0103aad:	55                   	push   %ebp
c0103aae:	89 e5                	mov    %esp,%ebp
c0103ab0:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
c0103ab3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ab6:	83 e0 01             	and    $0x1,%eax
c0103ab9:	85 c0                	test   %eax,%eax
c0103abb:	75 1c                	jne    c0103ad9 <pte2page+0x2c>
        panic("pte2page called with invalid pte");
c0103abd:	c7 44 24 08 d8 6e 10 	movl   $0xc0106ed8,0x8(%esp)
c0103ac4:	c0 
c0103ac5:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
c0103acc:	00 
c0103acd:	c7 04 24 a3 6e 10 c0 	movl   $0xc0106ea3,(%esp)
c0103ad4:	e8 b7 db ff ff       	call   c0101690 <__panic>
    }
    return pa2page(PTE_ADDR(pte));
c0103ad9:	8b 45 08             	mov    0x8(%ebp),%eax
c0103adc:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103ae1:	89 04 24             	mov    %eax,(%esp)
c0103ae4:	e8 2b ff ff ff       	call   c0103a14 <pa2page>
}
c0103ae9:	c9                   	leave  
c0103aea:	c3                   	ret    

c0103aeb <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c0103aeb:	55                   	push   %ebp
c0103aec:	89 e5                	mov    %esp,%ebp
c0103aee:	83 ec 10             	sub    $0x10,%esp
    return atomic_read(&(page->ref));
c0103af1:	8b 45 08             	mov    0x8(%ebp),%eax
c0103af4:	89 45 fc             	mov    %eax,-0x4(%ebp)
 *
 * Atomically reads the value of @v.
 * */
static inline int
atomic_read(const atomic_t *v) {
    return v->counter;
c0103af7:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103afa:	8b 00                	mov    (%eax),%eax
}
c0103afc:	c9                   	leave  
c0103afd:	c3                   	ret    

c0103afe <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c0103afe:	55                   	push   %ebp
c0103aff:	89 e5                	mov    %esp,%ebp
c0103b01:	83 ec 10             	sub    $0x10,%esp
    atomic_set(&(page->ref), val);
c0103b04:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b07:	89 45 fc             	mov    %eax,-0x4(%ebp)
c0103b0a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103b0d:	89 45 f8             	mov    %eax,-0x8(%ebp)
 *
 * Atomically sets the value of @v to @i.
 * */
static inline void
atomic_set(atomic_t *v, int i) {
    v->counter = i;
c0103b10:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0103b13:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0103b16:	89 10                	mov    %edx,(%eax)
}
c0103b18:	c9                   	leave  
c0103b19:	c3                   	ret    

c0103b1a <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c0103b1a:	55                   	push   %ebp
c0103b1b:	89 e5                	mov    %esp,%ebp
c0103b1d:	83 ec 10             	sub    $0x10,%esp
    return atomic_add_return(&(page->ref), 1);
c0103b20:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b23:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0103b26:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
 * Atomically adds @i to @v and returns @i + @v
 * Requires Modern 486+ processor
 * */
static inline int
atomic_add_return(atomic_t *v, int i) {
    int __i = i;
c0103b2d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b30:	89 45 fc             	mov    %eax,-0x4(%ebp)
    asm volatile("xaddl %0, %1" : "+r" (i), "+m" (v->counter) :: "memory");
c0103b33:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0103b36:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b39:	0f c1 02             	xadd   %eax,(%edx)
c0103b3c:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return i + __i;
c0103b3f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b42:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103b45:	8d 04 02             	lea    (%edx,%eax,1),%eax
}
c0103b48:	c9                   	leave  
c0103b49:	c3                   	ret    

c0103b4a <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c0103b4a:	55                   	push   %ebp
c0103b4b:	89 e5                	mov    %esp,%ebp
c0103b4d:	83 ec 20             	sub    $0x20,%esp
    return atomic_sub_return(&(page->ref), 1);
c0103b50:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b53:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103b56:	c7 45 ec 01 00 00 00 	movl   $0x1,-0x14(%ebp)
 *
 * Atomically subtracts @i from @v and returns @v - @i
 * */
static inline int
atomic_sub_return(atomic_t *v, int i) {
    return atomic_add_return(v, -i);
c0103b5d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103b60:	89 c2                	mov    %eax,%edx
c0103b62:	f7 da                	neg    %edx
c0103b64:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103b67:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0103b6a:	89 55 f4             	mov    %edx,-0xc(%ebp)
 * Atomically adds @i to @v and returns @i + @v
 * Requires Modern 486+ processor
 * */
static inline int
atomic_add_return(atomic_t *v, int i) {
    int __i = i;
c0103b6d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b70:	89 45 fc             	mov    %eax,-0x4(%ebp)
    asm volatile("xaddl %0, %1" : "+r" (i), "+m" (v->counter) :: "memory");
c0103b73:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0103b76:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b79:	0f c1 02             	xadd   %eax,(%edx)
c0103b7c:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return i + __i;
c0103b7f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b82:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0103b85:	8d 04 02             	lea    (%edx,%eax,1),%eax
}
c0103b88:	c9                   	leave  
c0103b89:	c3                   	ret    

c0103b8a <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0103b8a:	55                   	push   %ebp
c0103b8b:	89 e5                	mov    %esp,%ebp
c0103b8d:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0103b90:	9c                   	pushf  
c0103b91:	58                   	pop    %eax
c0103b92:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0103b95:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0103b98:	25 00 02 00 00       	and    $0x200,%eax
c0103b9d:	85 c0                	test   %eax,%eax
c0103b9f:	74 0c                	je     c0103bad <__intr_save+0x23>
        intr_disable();
c0103ba1:	e8 dc e4 ff ff       	call   c0102082 <intr_disable>
        return 1;
c0103ba6:	b8 01 00 00 00       	mov    $0x1,%eax
c0103bab:	eb 05                	jmp    c0103bb2 <__intr_save+0x28>
    }
    return 0;
c0103bad:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103bb2:	c9                   	leave  
c0103bb3:	c3                   	ret    

c0103bb4 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0103bb4:	55                   	push   %ebp
c0103bb5:	89 e5                	mov    %esp,%ebp
c0103bb7:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0103bba:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0103bbe:	74 05                	je     c0103bc5 <__intr_restore+0x11>
        intr_enable();
c0103bc0:	e8 b7 e4 ff ff       	call   c010207c <intr_enable>
    }
}
c0103bc5:	c9                   	leave  
c0103bc6:	c3                   	ret    

c0103bc7 <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
c0103bc7:	55                   	push   %ebp
c0103bc8:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
c0103bca:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bcd:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
c0103bd0:	b8 23 00 00 00       	mov    $0x23,%eax
c0103bd5:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
c0103bd7:	b8 23 00 00 00       	mov    $0x23,%eax
c0103bdc:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
c0103bde:	b8 10 00 00 00       	mov    $0x10,%eax
c0103be3:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
c0103be5:	b8 10 00 00 00       	mov    $0x10,%eax
c0103bea:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
c0103bec:	b8 10 00 00 00       	mov    $0x10,%eax
c0103bf1:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c0103bf3:	ea fa 3b 10 c0 08 00 	ljmp   $0x8,$0xc0103bfa
}
c0103bfa:	5d                   	pop    %ebp
c0103bfb:	c3                   	ret    

c0103bfc <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
c0103bfc:	55                   	push   %ebp
c0103bfd:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
c0103bff:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c02:	a3 64 a9 11 c0       	mov    %eax,0xc011a964
}
c0103c07:	5d                   	pop    %ebp
c0103c08:	c3                   	ret    

c0103c09 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
c0103c09:	55                   	push   %ebp
c0103c0a:	89 e5                	mov    %esp,%ebp
c0103c0c:	83 ec 14             	sub    $0x14,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
c0103c0f:	b8 00 90 11 c0       	mov    $0xc0119000,%eax
c0103c14:	89 04 24             	mov    %eax,(%esp)
c0103c17:	e8 e0 ff ff ff       	call   c0103bfc <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
c0103c1c:	66 c7 05 68 a9 11 c0 	movw   $0x10,0xc011a968
c0103c23:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
c0103c25:	66 c7 05 88 9a 11 c0 	movw   $0x68,0xc0119a88
c0103c2c:	68 00 
c0103c2e:	b8 60 a9 11 c0       	mov    $0xc011a960,%eax
c0103c33:	66 a3 8a 9a 11 c0    	mov    %ax,0xc0119a8a
c0103c39:	b8 60 a9 11 c0       	mov    $0xc011a960,%eax
c0103c3e:	c1 e8 10             	shr    $0x10,%eax
c0103c41:	a2 8c 9a 11 c0       	mov    %al,0xc0119a8c
c0103c46:	0f b6 05 8d 9a 11 c0 	movzbl 0xc0119a8d,%eax
c0103c4d:	83 e0 f0             	and    $0xfffffff0,%eax
c0103c50:	83 c8 09             	or     $0x9,%eax
c0103c53:	a2 8d 9a 11 c0       	mov    %al,0xc0119a8d
c0103c58:	0f b6 05 8d 9a 11 c0 	movzbl 0xc0119a8d,%eax
c0103c5f:	83 e0 ef             	and    $0xffffffef,%eax
c0103c62:	a2 8d 9a 11 c0       	mov    %al,0xc0119a8d
c0103c67:	0f b6 05 8d 9a 11 c0 	movzbl 0xc0119a8d,%eax
c0103c6e:	83 e0 9f             	and    $0xffffff9f,%eax
c0103c71:	a2 8d 9a 11 c0       	mov    %al,0xc0119a8d
c0103c76:	0f b6 05 8d 9a 11 c0 	movzbl 0xc0119a8d,%eax
c0103c7d:	83 c8 80             	or     $0xffffff80,%eax
c0103c80:	a2 8d 9a 11 c0       	mov    %al,0xc0119a8d
c0103c85:	0f b6 05 8e 9a 11 c0 	movzbl 0xc0119a8e,%eax
c0103c8c:	83 e0 f0             	and    $0xfffffff0,%eax
c0103c8f:	a2 8e 9a 11 c0       	mov    %al,0xc0119a8e
c0103c94:	0f b6 05 8e 9a 11 c0 	movzbl 0xc0119a8e,%eax
c0103c9b:	83 e0 ef             	and    $0xffffffef,%eax
c0103c9e:	a2 8e 9a 11 c0       	mov    %al,0xc0119a8e
c0103ca3:	0f b6 05 8e 9a 11 c0 	movzbl 0xc0119a8e,%eax
c0103caa:	83 e0 df             	and    $0xffffffdf,%eax
c0103cad:	a2 8e 9a 11 c0       	mov    %al,0xc0119a8e
c0103cb2:	0f b6 05 8e 9a 11 c0 	movzbl 0xc0119a8e,%eax
c0103cb9:	83 c8 40             	or     $0x40,%eax
c0103cbc:	a2 8e 9a 11 c0       	mov    %al,0xc0119a8e
c0103cc1:	0f b6 05 8e 9a 11 c0 	movzbl 0xc0119a8e,%eax
c0103cc8:	83 e0 7f             	and    $0x7f,%eax
c0103ccb:	a2 8e 9a 11 c0       	mov    %al,0xc0119a8e
c0103cd0:	b8 60 a9 11 c0       	mov    $0xc011a960,%eax
c0103cd5:	c1 e8 18             	shr    $0x18,%eax
c0103cd8:	a2 8f 9a 11 c0       	mov    %al,0xc0119a8f

    // reload all segment registers
    lgdt(&gdt_pd);
c0103cdd:	c7 04 24 90 9a 11 c0 	movl   $0xc0119a90,(%esp)
c0103ce4:	e8 de fe ff ff       	call   c0103bc7 <lgdt>
c0103ce9:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("cli");
}

static inline void
ltr(uint16_t sel) {
    asm volatile ("ltr %0" :: "r" (sel));
c0103cef:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0103cf3:	0f 00 d8             	ltr    %ax

    // load the TSS
    ltr(GD_TSS);
}
c0103cf6:	c9                   	leave  
c0103cf7:	c3                   	ret    

c0103cf8 <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
c0103cf8:	55                   	push   %ebp
c0103cf9:	89 e5                	mov    %esp,%ebp
c0103cfb:	83 ec 18             	sub    $0x18,%esp
    pmm_manager = &default_pmm_manager;
c0103cfe:	c7 05 d0 a9 11 c0 68 	movl   $0xc0106e68,0xc011a9d0
c0103d05:	6e 10 c0 
    cprintf("memory managment: %s\n", pmm_manager->name);
c0103d08:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103d0d:	8b 00                	mov    (%eax),%eax
c0103d0f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103d13:	c7 04 24 04 6f 10 c0 	movl   $0xc0106f04,(%esp)
c0103d1a:	e8 8d c4 ff ff       	call   c01001ac <cprintf>
    pmm_manager->init();
c0103d1f:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103d24:	8b 40 04             	mov    0x4(%eax),%eax
c0103d27:	ff d0                	call   *%eax
}
c0103d29:	c9                   	leave  
c0103d2a:	c3                   	ret    

c0103d2b <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
c0103d2b:	55                   	push   %ebp
c0103d2c:	89 e5                	mov    %esp,%ebp
c0103d2e:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
c0103d31:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103d36:	8b 50 08             	mov    0x8(%eax),%edx
c0103d39:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103d3c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103d40:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d43:	89 04 24             	mov    %eax,(%esp)
c0103d46:	ff d2                	call   *%edx
}
c0103d48:	c9                   	leave  
c0103d49:	c3                   	ret    

c0103d4a <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
c0103d4a:	55                   	push   %ebp
c0103d4b:	89 e5                	mov    %esp,%ebp
c0103d4d:	83 ec 28             	sub    $0x28,%esp
    struct Page *page;
    bool intr_flag;
    local_intr_save(intr_flag);
c0103d50:	e8 35 fe ff ff       	call   c0103b8a <__intr_save>
c0103d55:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        page = pmm_manager->alloc_pages(n);
c0103d58:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103d5d:	8b 50 0c             	mov    0xc(%eax),%edx
c0103d60:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d63:	89 04 24             	mov    %eax,(%esp)
c0103d66:	ff d2                	call   *%edx
c0103d68:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
c0103d6b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103d6e:	89 04 24             	mov    %eax,(%esp)
c0103d71:	e8 3e fe ff ff       	call   c0103bb4 <__intr_restore>
    return page;
c0103d76:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0103d79:	c9                   	leave  
c0103d7a:	c3                   	ret    

c0103d7b <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
c0103d7b:	55                   	push   %ebp
c0103d7c:	89 e5                	mov    %esp,%ebp
c0103d7e:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0103d81:	e8 04 fe ff ff       	call   c0103b8a <__intr_save>
c0103d86:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
c0103d89:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103d8e:	8b 50 10             	mov    0x10(%eax),%edx
c0103d91:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103d94:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103d98:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d9b:	89 04 24             	mov    %eax,(%esp)
c0103d9e:	ff d2                	call   *%edx
    }
    local_intr_restore(intr_flag);
c0103da0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103da3:	89 04 24             	mov    %eax,(%esp)
c0103da6:	e8 09 fe ff ff       	call   c0103bb4 <__intr_restore>
}
c0103dab:	c9                   	leave  
c0103dac:	c3                   	ret    

c0103dad <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
c0103dad:	55                   	push   %ebp
c0103dae:	89 e5                	mov    %esp,%ebp
c0103db0:	83 ec 28             	sub    $0x28,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
c0103db3:	e8 d2 fd ff ff       	call   c0103b8a <__intr_save>
c0103db8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
c0103dbb:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c0103dc0:	8b 40 14             	mov    0x14(%eax),%eax
c0103dc3:	ff d0                	call   *%eax
c0103dc5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
c0103dc8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103dcb:	89 04 24             	mov    %eax,(%esp)
c0103dce:	e8 e1 fd ff ff       	call   c0103bb4 <__intr_restore>
    return ret;
c0103dd3:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0103dd6:	c9                   	leave  
c0103dd7:	c3                   	ret    

c0103dd8 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
c0103dd8:	55                   	push   %ebp
c0103dd9:	89 e5                	mov    %esp,%ebp
c0103ddb:	57                   	push   %edi
c0103ddc:	56                   	push   %esi
c0103ddd:	53                   	push   %ebx
c0103dde:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c0103de4:	c7 45 8c 00 80 00 c0 	movl   $0xc0008000,-0x74(%ebp)
    uint64_t maxpa = 0;
c0103deb:	c7 45 90 00 00 00 00 	movl   $0x0,-0x70(%ebp)
c0103df2:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)

    cprintf("e820map:\n");
c0103df9:	c7 04 24 1a 6f 10 c0 	movl   $0xc0106f1a,(%esp)
c0103e00:	e8 a7 c3 ff ff       	call   c01001ac <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
c0103e05:	c7 45 98 00 00 00 00 	movl   $0x0,-0x68(%ebp)
c0103e0c:	e9 11 01 00 00       	jmp    c0103f22 <page_init+0x14a>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0103e11:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103e14:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0103e17:	89 d0                	mov    %edx,%eax
c0103e19:	c1 e0 02             	shl    $0x2,%eax
c0103e1c:	01 d0                	add    %edx,%eax
c0103e1e:	c1 e0 02             	shl    $0x2,%eax
c0103e21:	8b 54 08 08          	mov    0x8(%eax,%ecx,1),%edx
c0103e25:	8b 44 08 04          	mov    0x4(%eax,%ecx,1),%eax
c0103e29:	89 45 a0             	mov    %eax,-0x60(%ebp)
c0103e2c:	89 55 a4             	mov    %edx,-0x5c(%ebp)
c0103e2f:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103e32:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0103e35:	89 d0                	mov    %edx,%eax
c0103e37:	c1 e0 02             	shl    $0x2,%eax
c0103e3a:	01 d0                	add    %edx,%eax
c0103e3c:	c1 e0 02             	shl    $0x2,%eax
c0103e3f:	8b 54 08 10          	mov    0x10(%eax,%ecx,1),%edx
c0103e43:	8b 44 08 0c          	mov    0xc(%eax,%ecx,1),%eax
c0103e47:	03 45 a0             	add    -0x60(%ebp),%eax
c0103e4a:	13 55 a4             	adc    -0x5c(%ebp),%edx
c0103e4d:	89 45 a8             	mov    %eax,-0x58(%ebp)
c0103e50:	89 55 ac             	mov    %edx,-0x54(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c0103e53:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103e56:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0103e59:	89 d0                	mov    %edx,%eax
c0103e5b:	c1 e0 02             	shl    $0x2,%eax
c0103e5e:	01 d0                	add    %edx,%eax
c0103e60:	c1 e0 02             	shl    $0x2,%eax
c0103e63:	01 c8                	add    %ecx,%eax
c0103e65:	83 c0 14             	add    $0x14,%eax
c0103e68:	8b 00                	mov    (%eax),%eax
c0103e6a:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
c0103e70:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103e73:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0103e76:	89 c6                	mov    %eax,%esi
c0103e78:	89 d7                	mov    %edx,%edi
c0103e7a:	83 c6 ff             	add    $0xffffffff,%esi
c0103e7d:	83 d7 ff             	adc    $0xffffffff,%edi
c0103e80:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103e83:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0103e86:	89 d0                	mov    %edx,%eax
c0103e88:	c1 e0 02             	shl    $0x2,%eax
c0103e8b:	01 d0                	add    %edx,%eax
c0103e8d:	c1 e0 02             	shl    $0x2,%eax
c0103e90:	8b 5c 08 10          	mov    0x10(%eax,%ecx,1),%ebx
c0103e94:	8b 4c 08 0c          	mov    0xc(%eax,%ecx,1),%ecx
c0103e98:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
c0103e9e:	89 44 24 1c          	mov    %eax,0x1c(%esp)
c0103ea2:	89 74 24 14          	mov    %esi,0x14(%esp)
c0103ea6:	89 7c 24 18          	mov    %edi,0x18(%esp)
c0103eaa:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0103ead:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0103eb0:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103eb4:	89 54 24 10          	mov    %edx,0x10(%esp)
c0103eb8:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c0103ebc:	89 5c 24 08          	mov    %ebx,0x8(%esp)
c0103ec0:	c7 04 24 24 6f 10 c0 	movl   $0xc0106f24,(%esp)
c0103ec7:	e8 e0 c2 ff ff       	call   c01001ac <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
c0103ecc:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103ecf:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0103ed2:	89 d0                	mov    %edx,%eax
c0103ed4:	c1 e0 02             	shl    $0x2,%eax
c0103ed7:	01 d0                	add    %edx,%eax
c0103ed9:	c1 e0 02             	shl    $0x2,%eax
c0103edc:	01 c8                	add    %ecx,%eax
c0103ede:	83 c0 14             	add    $0x14,%eax
c0103ee1:	8b 00                	mov    (%eax),%eax
c0103ee3:	83 f8 01             	cmp    $0x1,%eax
c0103ee6:	75 36                	jne    c0103f1e <page_init+0x146>
            if (maxpa < end && begin < KMEMSIZE) {
c0103ee8:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103eeb:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0103eee:	3b 55 ac             	cmp    -0x54(%ebp),%edx
c0103ef1:	77 2b                	ja     c0103f1e <page_init+0x146>
c0103ef3:	3b 55 ac             	cmp    -0x54(%ebp),%edx
c0103ef6:	72 05                	jb     c0103efd <page_init+0x125>
c0103ef8:	3b 45 a8             	cmp    -0x58(%ebp),%eax
c0103efb:	73 21                	jae    c0103f1e <page_init+0x146>
c0103efd:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c0103f01:	77 1b                	ja     c0103f1e <page_init+0x146>
c0103f03:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c0103f07:	72 09                	jb     c0103f12 <page_init+0x13a>
c0103f09:	81 7d a0 ff ff ff 37 	cmpl   $0x37ffffff,-0x60(%ebp)
c0103f10:	77 0c                	ja     c0103f1e <page_init+0x146>
                maxpa = end;
c0103f12:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0103f15:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0103f18:	89 45 90             	mov    %eax,-0x70(%ebp)
c0103f1b:	89 55 94             	mov    %edx,-0x6c(%ebp)
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
    uint64_t maxpa = 0;

    cprintf("e820map:\n");
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
c0103f1e:	83 45 98 01          	addl   $0x1,-0x68(%ebp)
c0103f22:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0103f25:	8b 00                	mov    (%eax),%eax
c0103f27:	3b 45 98             	cmp    -0x68(%ebp),%eax
c0103f2a:	0f 8f e1 fe ff ff    	jg     c0103e11 <page_init+0x39>
            if (maxpa < end && begin < KMEMSIZE) {
                maxpa = end;
            }
        }
    }
    if (maxpa > KMEMSIZE) {
c0103f30:	83 7d 94 00          	cmpl   $0x0,-0x6c(%ebp)
c0103f34:	72 1d                	jb     c0103f53 <page_init+0x17b>
c0103f36:	83 7d 94 00          	cmpl   $0x0,-0x6c(%ebp)
c0103f3a:	77 09                	ja     c0103f45 <page_init+0x16d>
c0103f3c:	81 7d 90 00 00 00 38 	cmpl   $0x38000000,-0x70(%ebp)
c0103f43:	76 0e                	jbe    c0103f53 <page_init+0x17b>
        maxpa = KMEMSIZE;
c0103f45:	c7 45 90 00 00 00 38 	movl   $0x38000000,-0x70(%ebp)
c0103f4c:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
c0103f53:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103f56:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0103f59:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0103f5d:	c1 ea 0c             	shr    $0xc,%edx
c0103f60:	a3 40 a9 11 c0       	mov    %eax,0xc011a940
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
c0103f65:	c7 45 b4 00 10 00 00 	movl   $0x1000,-0x4c(%ebp)
c0103f6c:	b8 dc a9 11 c0       	mov    $0xc011a9dc,%eax
c0103f71:	83 e8 01             	sub    $0x1,%eax
c0103f74:	03 45 b4             	add    -0x4c(%ebp),%eax
c0103f77:	89 45 b8             	mov    %eax,-0x48(%ebp)
c0103f7a:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0103f7d:	ba 00 00 00 00       	mov    $0x0,%edx
c0103f82:	f7 75 b4             	divl   -0x4c(%ebp)
c0103f85:	89 d0                	mov    %edx,%eax
c0103f87:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0103f8a:	89 d1                	mov    %edx,%ecx
c0103f8c:	29 c1                	sub    %eax,%ecx
c0103f8e:	89 c8                	mov    %ecx,%eax
c0103f90:	a3 d8 a9 11 c0       	mov    %eax,0xc011a9d8

    for (i = 0; i < npage; i ++) {
c0103f95:	c7 45 98 00 00 00 00 	movl   $0x0,-0x68(%ebp)
c0103f9c:	eb 27                	jmp    c0103fc5 <page_init+0x1ed>
        SetPageReserved(pages + i);
c0103f9e:	a1 d8 a9 11 c0       	mov    0xc011a9d8,%eax
c0103fa3:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103fa6:	c1 e2 04             	shl    $0x4,%edx
c0103fa9:	01 d0                	add    %edx,%eax
c0103fab:	83 c0 04             	add    $0x4,%eax
c0103fae:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c0103fb5:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * Note that @nr may be almost arbitrarily large; this function is not
 * restricted to acting on a single-word quantity.
 * */
static inline void
set_bit(int nr, volatile void *addr) {
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0103fb8:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103fbb:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0103fbe:	0f ab 10             	bts    %edx,(%eax)
    extern char end[];

    npage = maxpa / PGSIZE;
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);

    for (i = 0; i < npage; i ++) {
c0103fc1:	83 45 98 01          	addl   $0x1,-0x68(%ebp)
c0103fc5:	8b 55 98             	mov    -0x68(%ebp),%edx
c0103fc8:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0103fcd:	39 c2                	cmp    %eax,%edx
c0103fcf:	72 cd                	jb     c0103f9e <page_init+0x1c6>
        SetPageReserved(pages + i);
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
c0103fd1:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0103fd6:	89 c2                	mov    %eax,%edx
c0103fd8:	c1 e2 04             	shl    $0x4,%edx
c0103fdb:	a1 d8 a9 11 c0       	mov    0xc011a9d8,%eax
c0103fe0:	8d 04 02             	lea    (%edx,%eax,1),%eax
c0103fe3:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0103fe6:	81 7d bc ff ff ff bf 	cmpl   $0xbfffffff,-0x44(%ebp)
c0103fed:	77 23                	ja     c0104012 <page_init+0x23a>
c0103fef:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0103ff2:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103ff6:	c7 44 24 08 54 6f 10 	movl   $0xc0106f54,0x8(%esp)
c0103ffd:	c0 
c0103ffe:	c7 44 24 04 db 00 00 	movl   $0xdb,0x4(%esp)
c0104005:	00 
c0104006:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010400d:	e8 7e d6 ff ff       	call   c0101690 <__panic>
c0104012:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0104015:	05 00 00 00 40       	add    $0x40000000,%eax
c010401a:	89 45 9c             	mov    %eax,-0x64(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
c010401d:	c7 45 98 00 00 00 00 	movl   $0x0,-0x68(%ebp)
c0104024:	e9 71 01 00 00       	jmp    c010419a <page_init+0x3c2>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0104029:	8b 55 98             	mov    -0x68(%ebp),%edx
c010402c:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c010402f:	89 d0                	mov    %edx,%eax
c0104031:	c1 e0 02             	shl    $0x2,%eax
c0104034:	01 d0                	add    %edx,%eax
c0104036:	c1 e0 02             	shl    $0x2,%eax
c0104039:	8b 54 08 08          	mov    0x8(%eax,%ecx,1),%edx
c010403d:	8b 44 08 04          	mov    0x4(%eax,%ecx,1),%eax
c0104041:	89 45 c0             	mov    %eax,-0x40(%ebp)
c0104044:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c0104047:	8b 55 98             	mov    -0x68(%ebp),%edx
c010404a:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c010404d:	89 d0                	mov    %edx,%eax
c010404f:	c1 e0 02             	shl    $0x2,%eax
c0104052:	01 d0                	add    %edx,%eax
c0104054:	c1 e0 02             	shl    $0x2,%eax
c0104057:	8b 54 08 10          	mov    0x10(%eax,%ecx,1),%edx
c010405b:	8b 44 08 0c          	mov    0xc(%eax,%ecx,1),%eax
c010405f:	03 45 c0             	add    -0x40(%ebp),%eax
c0104062:	13 55 c4             	adc    -0x3c(%ebp),%edx
c0104065:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0104068:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
c010406b:	8b 55 98             	mov    -0x68(%ebp),%edx
c010406e:	8b 4d 8c             	mov    -0x74(%ebp),%ecx
c0104071:	89 d0                	mov    %edx,%eax
c0104073:	c1 e0 02             	shl    $0x2,%eax
c0104076:	01 d0                	add    %edx,%eax
c0104078:	c1 e0 02             	shl    $0x2,%eax
c010407b:	01 c8                	add    %ecx,%eax
c010407d:	83 c0 14             	add    $0x14,%eax
c0104080:	8b 00                	mov    (%eax),%eax
c0104082:	83 f8 01             	cmp    $0x1,%eax
c0104085:	0f 85 0b 01 00 00    	jne    c0104196 <page_init+0x3be>
            if (begin < freemem) {
c010408b:	8b 45 9c             	mov    -0x64(%ebp),%eax
c010408e:	ba 00 00 00 00       	mov    $0x0,%edx
c0104093:	3b 55 c4             	cmp    -0x3c(%ebp),%edx
c0104096:	72 18                	jb     c01040b0 <page_init+0x2d8>
c0104098:	3b 55 c4             	cmp    -0x3c(%ebp),%edx
c010409b:	77 05                	ja     c01040a2 <page_init+0x2ca>
c010409d:	3b 45 c0             	cmp    -0x40(%ebp),%eax
c01040a0:	76 0e                	jbe    c01040b0 <page_init+0x2d8>
                begin = freemem;
c01040a2:	8b 45 9c             	mov    -0x64(%ebp),%eax
c01040a5:	ba 00 00 00 00       	mov    $0x0,%edx
c01040aa:	89 45 c0             	mov    %eax,-0x40(%ebp)
c01040ad:	89 55 c4             	mov    %edx,-0x3c(%ebp)
            }
            if (end > KMEMSIZE) {
c01040b0:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
c01040b4:	72 1d                	jb     c01040d3 <page_init+0x2fb>
c01040b6:	83 7d cc 00          	cmpl   $0x0,-0x34(%ebp)
c01040ba:	77 09                	ja     c01040c5 <page_init+0x2ed>
c01040bc:	81 7d c8 00 00 00 38 	cmpl   $0x38000000,-0x38(%ebp)
c01040c3:	76 0e                	jbe    c01040d3 <page_init+0x2fb>
                end = KMEMSIZE;
c01040c5:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c01040cc:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
c01040d3:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01040d6:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c01040d9:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c01040dc:	0f 87 b4 00 00 00    	ja     c0104196 <page_init+0x3be>
c01040e2:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c01040e5:	72 09                	jb     c01040f0 <page_init+0x318>
c01040e7:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c01040ea:	0f 83 a6 00 00 00    	jae    c0104196 <page_init+0x3be>
                begin = ROUNDUP(begin, PGSIZE);
c01040f0:	c7 45 d4 00 10 00 00 	movl   $0x1000,-0x2c(%ebp)
c01040f7:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01040fa:	03 45 d4             	add    -0x2c(%ebp),%eax
c01040fd:	83 e8 01             	sub    $0x1,%eax
c0104100:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0104103:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104106:	ba 00 00 00 00       	mov    $0x0,%edx
c010410b:	f7 75 d4             	divl   -0x2c(%ebp)
c010410e:	89 d0                	mov    %edx,%eax
c0104110:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0104113:	89 d1                	mov    %edx,%ecx
c0104115:	29 c1                	sub    %eax,%ecx
c0104117:	89 c8                	mov    %ecx,%eax
c0104119:	ba 00 00 00 00       	mov    $0x0,%edx
c010411e:	89 45 c0             	mov    %eax,-0x40(%ebp)
c0104121:	89 55 c4             	mov    %edx,-0x3c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
c0104124:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104127:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010412a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010412d:	ba 00 00 00 00       	mov    $0x0,%edx
c0104132:	89 c1                	mov    %eax,%ecx
c0104134:	81 e1 00 f0 ff ff    	and    $0xfffff000,%ecx
c010413a:	89 4d 80             	mov    %ecx,-0x80(%ebp)
c010413d:	89 d1                	mov    %edx,%ecx
c010413f:	83 e1 00             	and    $0x0,%ecx
c0104142:	89 4d 84             	mov    %ecx,-0x7c(%ebp)
c0104145:	8b 45 80             	mov    -0x80(%ebp),%eax
c0104148:	8b 55 84             	mov    -0x7c(%ebp),%edx
c010414b:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010414e:	89 55 cc             	mov    %edx,-0x34(%ebp)
                if (begin < end) {
c0104151:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0104154:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0104157:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c010415a:	77 3a                	ja     c0104196 <page_init+0x3be>
c010415c:	3b 55 cc             	cmp    -0x34(%ebp),%edx
c010415f:	72 05                	jb     c0104166 <page_init+0x38e>
c0104161:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0104164:	73 30                	jae    c0104196 <page_init+0x3be>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
c0104166:	8b 4d c0             	mov    -0x40(%ebp),%ecx
c0104169:	8b 5d c4             	mov    -0x3c(%ebp),%ebx
c010416c:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010416f:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0104172:	29 c8                	sub    %ecx,%eax
c0104174:	19 da                	sbb    %ebx,%edx
c0104176:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c010417a:	c1 ea 0c             	shr    $0xc,%edx
c010417d:	89 c3                	mov    %eax,%ebx
c010417f:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0104182:	89 04 24             	mov    %eax,(%esp)
c0104185:	e8 8a f8 ff ff       	call   c0103a14 <pa2page>
c010418a:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c010418e:	89 04 24             	mov    %eax,(%esp)
c0104191:	e8 95 fb ff ff       	call   c0103d2b <init_memmap>
        SetPageReserved(pages + i);
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);

    for (i = 0; i < memmap->nr_map; i ++) {
c0104196:	83 45 98 01          	addl   $0x1,-0x68(%ebp)
c010419a:	8b 45 8c             	mov    -0x74(%ebp),%eax
c010419d:	8b 00                	mov    (%eax),%eax
c010419f:	3b 45 98             	cmp    -0x68(%ebp),%eax
c01041a2:	0f 8f 81 fe ff ff    	jg     c0104029 <page_init+0x251>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
                }
            }
        }
    }
}
c01041a8:	81 c4 9c 00 00 00    	add    $0x9c,%esp
c01041ae:	5b                   	pop    %ebx
c01041af:	5e                   	pop    %esi
c01041b0:	5f                   	pop    %edi
c01041b1:	5d                   	pop    %ebp
c01041b2:	c3                   	ret    

c01041b3 <enable_paging>:

static void
enable_paging(void) {
c01041b3:	55                   	push   %ebp
c01041b4:	89 e5                	mov    %esp,%ebp
c01041b6:	83 ec 10             	sub    $0x10,%esp
    lcr3(boot_cr3);
c01041b9:	a1 d4 a9 11 c0       	mov    0xc011a9d4,%eax
c01041be:	89 45 f4             	mov    %eax,-0xc(%ebp)
    asm volatile ("mov %0, %%cr0" :: "r" (cr0));
}

static inline void
lcr3(uintptr_t cr3) {
    asm volatile ("mov %0, %%cr3" :: "r" (cr3));
c01041c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01041c4:	0f 22 d8             	mov    %eax,%cr3
}

static inline uintptr_t
rcr0(void) {
    uintptr_t cr0;
    asm volatile ("mov %%cr0, %0" : "=r" (cr0));
c01041c7:	0f 20 c0             	mov    %cr0,%eax
c01041ca:	89 45 f8             	mov    %eax,-0x8(%ebp)
    return cr0;
c01041cd:	8b 45 f8             	mov    -0x8(%ebp),%eax

    // turn on paging
    uint32_t cr0 = rcr0();
c01041d0:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cr0 |= CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP;
c01041d3:	81 4d f0 2f 00 05 80 	orl    $0x8005002f,-0x10(%ebp)
    cr0 &= ~(CR0_TS | CR0_EM);
c01041da:	83 65 f0 f3          	andl   $0xfffffff3,-0x10(%ebp)
c01041de:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01041e1:	89 45 fc             	mov    %eax,-0x4(%ebp)
    asm volatile ("pushl %0; popfl" :: "r" (eflags));
}

static inline void
lcr0(uintptr_t cr0) {
    asm volatile ("mov %0, %%cr0" :: "r" (cr0));
c01041e4:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01041e7:	0f 22 c0             	mov    %eax,%cr0
    lcr0(cr0);
}
c01041ea:	c9                   	leave  
c01041eb:	c3                   	ret    

c01041ec <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c01041ec:	55                   	push   %ebp
c01041ed:	89 e5                	mov    %esp,%ebp
c01041ef:	83 ec 38             	sub    $0x38,%esp
    assert(PGOFF(la) == PGOFF(pa));
c01041f2:	8b 45 14             	mov    0x14(%ebp),%eax
c01041f5:	8b 55 0c             	mov    0xc(%ebp),%edx
c01041f8:	31 d0                	xor    %edx,%eax
c01041fa:	25 ff 0f 00 00       	and    $0xfff,%eax
c01041ff:	85 c0                	test   %eax,%eax
c0104201:	74 24                	je     c0104227 <boot_map_segment+0x3b>
c0104203:	c7 44 24 0c 86 6f 10 	movl   $0xc0106f86,0xc(%esp)
c010420a:	c0 
c010420b:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104212:	c0 
c0104213:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
c010421a:	00 
c010421b:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104222:	e8 69 d4 ff ff       	call   c0101690 <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c0104227:	c7 45 e4 00 10 00 00 	movl   $0x1000,-0x1c(%ebp)
c010422e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104231:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104236:	03 45 10             	add    0x10(%ebp),%eax
c0104239:	03 45 e4             	add    -0x1c(%ebp),%eax
c010423c:	83 e8 01             	sub    $0x1,%eax
c010423f:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104242:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104245:	ba 00 00 00 00       	mov    $0x0,%edx
c010424a:	f7 75 e4             	divl   -0x1c(%ebp)
c010424d:	89 d0                	mov    %edx,%eax
c010424f:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0104252:	89 d1                	mov    %edx,%ecx
c0104254:	29 c1                	sub    %eax,%ecx
c0104256:	89 c8                	mov    %ecx,%eax
c0104258:	c1 e8 0c             	shr    $0xc,%eax
c010425b:	89 45 e0             	mov    %eax,-0x20(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
c010425e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104261:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104264:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104267:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010426c:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
c010426f:	8b 45 14             	mov    0x14(%ebp),%eax
c0104272:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104275:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104278:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010427d:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104280:	eb 6b                	jmp    c01042ed <boot_map_segment+0x101>
        pte_t *ptep = get_pte(pgdir, la, 1);
c0104282:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104289:	00 
c010428a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010428d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104291:	8b 45 08             	mov    0x8(%ebp),%eax
c0104294:	89 04 24             	mov    %eax,(%esp)
c0104297:	e8 ce 01 00 00       	call   c010446a <get_pte>
c010429c:	89 45 f4             	mov    %eax,-0xc(%ebp)
        assert(ptep != NULL);
c010429f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01042a3:	75 24                	jne    c01042c9 <boot_map_segment+0xdd>
c01042a5:	c7 44 24 0c b2 6f 10 	movl   $0xc0106fb2,0xc(%esp)
c01042ac:	c0 
c01042ad:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c01042b4:	c0 
c01042b5:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
c01042bc:	00 
c01042bd:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01042c4:	e8 c7 d3 ff ff       	call   c0101690 <__panic>
        *ptep = pa | PTE_P | perm;
c01042c9:	8b 45 18             	mov    0x18(%ebp),%eax
c01042cc:	8b 55 14             	mov    0x14(%ebp),%edx
c01042cf:	09 d0                	or     %edx,%eax
c01042d1:	89 c2                	mov    %eax,%edx
c01042d3:	83 ca 01             	or     $0x1,%edx
c01042d6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01042d9:	89 10                	mov    %edx,(%eax)
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
    assert(PGOFF(la) == PGOFF(pa));
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
    la = ROUNDDOWN(la, PGSIZE);
    pa = ROUNDDOWN(pa, PGSIZE);
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c01042db:	83 6d e0 01          	subl   $0x1,-0x20(%ebp)
c01042df:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c01042e6:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c01042ed:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c01042f1:	75 8f                	jne    c0104282 <boot_map_segment+0x96>
        pte_t *ptep = get_pte(pgdir, la, 1);
        assert(ptep != NULL);
        *ptep = pa | PTE_P | perm;
    }
}
c01042f3:	c9                   	leave  
c01042f4:	c3                   	ret    

c01042f5 <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
c01042f5:	55                   	push   %ebp
c01042f6:	89 e5                	mov    %esp,%ebp
c01042f8:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();
c01042fb:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104302:	e8 43 fa ff ff       	call   c0103d4a <alloc_pages>
c0104307:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
c010430a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010430e:	75 1c                	jne    c010432c <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");
c0104310:	c7 44 24 08 bf 6f 10 	movl   $0xc0106fbf,0x8(%esp)
c0104317:	c0 
c0104318:	c7 44 24 04 16 01 00 	movl   $0x116,0x4(%esp)
c010431f:	00 
c0104320:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104327:	e8 64 d3 ff ff       	call   c0101690 <__panic>
    }
    return page2kva(p);
c010432c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010432f:	89 04 24             	mov    %eax,(%esp)
c0104332:	e8 22 f7 ff ff       	call   c0103a59 <page2kva>
}
c0104337:	c9                   	leave  
c0104338:	c3                   	ret    

c0104339 <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
c0104339:	55                   	push   %ebp
c010433a:	89 e5                	mov    %esp,%ebp
c010433c:	83 ec 38             	sub    $0x38,%esp
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
c010433f:	e8 b4 f9 ff ff       	call   c0103cf8 <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
c0104344:	e8 8f fa ff ff       	call   c0103dd8 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
c0104349:	e8 62 04 00 00       	call   c01047b0 <check_alloc_page>

    // create boot_pgdir, an initial page directory(Page Directory Table, PDT)
    boot_pgdir = boot_alloc_page();
c010434e:	e8 a2 ff ff ff       	call   c01042f5 <boot_alloc_page>
c0104353:	a3 44 a9 11 c0       	mov    %eax,0xc011a944
    memset(boot_pgdir, 0, PGSIZE);
c0104358:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c010435d:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104364:	00 
c0104365:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c010436c:	00 
c010436d:	89 04 24             	mov    %eax,(%esp)
c0104370:	e8 c2 1a 00 00       	call   c0105e37 <memset>
    boot_cr3 = PADDR(boot_pgdir);
c0104375:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c010437a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010437d:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c0104384:	77 23                	ja     c01043a9 <pmm_init+0x70>
c0104386:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104389:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010438d:	c7 44 24 08 54 6f 10 	movl   $0xc0106f54,0x8(%esp)
c0104394:	c0 
c0104395:	c7 44 24 04 30 01 00 	movl   $0x130,0x4(%esp)
c010439c:	00 
c010439d:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01043a4:	e8 e7 d2 ff ff       	call   c0101690 <__panic>
c01043a9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01043ac:	05 00 00 00 40       	add    $0x40000000,%eax
c01043b1:	a3 d4 a9 11 c0       	mov    %eax,0xc011a9d4

    check_pgdir();
c01043b6:	e8 13 04 00 00       	call   c01047ce <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
c01043bb:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01043c0:	8d 90 ac 0f 00 00    	lea    0xfac(%eax),%edx
c01043c6:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01043cb:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01043ce:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01043d5:	77 23                	ja     c01043fa <pmm_init+0xc1>
c01043d7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01043da:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01043de:	c7 44 24 08 54 6f 10 	movl   $0xc0106f54,0x8(%esp)
c01043e5:	c0 
c01043e6:	c7 44 24 04 38 01 00 	movl   $0x138,0x4(%esp)
c01043ed:	00 
c01043ee:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01043f5:	e8 96 d2 ff ff       	call   c0101690 <__panic>
c01043fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01043fd:	05 00 00 00 40       	add    $0x40000000,%eax
c0104402:	83 c8 03             	or     $0x3,%eax
c0104405:	89 02                	mov    %eax,(%edx)

    // map all physical memory to linear memory with base linear addr KERNBASE
    //linear_addr KERNBASE~KERNBASE+KMEMSIZE = phy_addr 0~KMEMSIZE
    //But shouldn't use this map until enable_paging() & gdt_init() finished.
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
c0104407:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c010440c:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
c0104413:	00 
c0104414:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c010441b:	00 
c010441c:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
c0104423:	38 
c0104424:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
c010442b:	c0 
c010442c:	89 04 24             	mov    %eax,(%esp)
c010442f:	e8 b8 fd ff ff       	call   c01041ec <boot_map_segment>

    //temporary map: 
    //virtual_addr 3G~3G+4M = linear_addr 0~4M = linear_addr 3G~3G+4M = phy_addr 0~4M 	
    boot_pgdir[0] = boot_pgdir[PDX(KERNBASE)];
c0104434:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104439:	8b 15 44 a9 11 c0    	mov    0xc011a944,%edx
c010443f:	81 c2 00 0c 00 00    	add    $0xc00,%edx
c0104445:	8b 12                	mov    (%edx),%edx
c0104447:	89 10                	mov    %edx,(%eax)

    enable_paging();
c0104449:	e8 65 fd ff ff       	call   c01041b3 <enable_paging>

    //reload gdt(third time,the last time) to map all physical memory
    //virtual_addr 0~4G=liear_addr 0~4G
    //then set kernel stack(ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
c010444e:	e8 b6 f7 ff ff       	call   c0103c09 <gdt_init>

    //disable the map of virtual_addr 0~4M
    boot_pgdir[0] = 0;
c0104453:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104458:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
c010445e:	e8 06 0a 00 00       	call   c0104e69 <check_boot_pgdir>

    print_pgdir();
c0104463:	e8 7f 0e 00 00       	call   c01052e7 <print_pgdir>
}
c0104468:	c9                   	leave  
c0104469:	c3                   	ret    

c010446a <get_pte>:
//  pgdir:  the kernel virtual base address of PDT
//  la:     the linear address need to map
//  create: a logical value to decide if alloc a page for PT
// return vaule: the kernel virtual address of this pte
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c010446a:	55                   	push   %ebp
c010446b:	89 e5                	mov    %esp,%ebp
c010446d:	83 ec 38             	sub    $0x38,%esp
    pde_t *pdep = &pgdir[PDX(la)];
c0104470:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104473:	c1 e8 16             	shr    $0x16,%eax
c0104476:	c1 e0 02             	shl    $0x2,%eax
c0104479:	03 45 08             	add    0x8(%ebp),%eax
c010447c:	89 45 dc             	mov    %eax,-0x24(%ebp)
    if (!(*pdep & PTE_P)) {
c010447f:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104482:	8b 00                	mov    (%eax),%eax
c0104484:	83 e0 01             	and    $0x1,%eax
c0104487:	85 c0                	test   %eax,%eax
c0104489:	0f 85 af 00 00 00    	jne    c010453e <get_pte+0xd4>
        struct Page *page;
        if (!create || (page = alloc_page()) == NULL) {
c010448f:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0104493:	74 15                	je     c01044aa <get_pte+0x40>
c0104495:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010449c:	e8 a9 f8 ff ff       	call   c0103d4a <alloc_pages>
c01044a1:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01044a4:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c01044a8:	75 0a                	jne    c01044b4 <get_pte+0x4a>
            return NULL;
c01044aa:	b8 00 00 00 00       	mov    $0x0,%eax
c01044af:	e9 e6 00 00 00       	jmp    c010459a <get_pte+0x130>
        }
        set_page_ref(page, 1);
c01044b4:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01044bb:	00 
c01044bc:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01044bf:	89 04 24             	mov    %eax,(%esp)
c01044c2:	e8 37 f6 ff ff       	call   c0103afe <set_page_ref>
        uintptr_t pa = page2pa(page);
c01044c7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01044ca:	89 04 24             	mov    %eax,(%esp)
c01044cd:	e8 2c f5 ff ff       	call   c01039fe <page2pa>
c01044d2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        memset(KADDR(pa), 0, PGSIZE);
c01044d5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01044d8:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01044db:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01044de:	c1 e8 0c             	shr    $0xc,%eax
c01044e1:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01044e4:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c01044e9:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c01044ec:	72 23                	jb     c0104511 <get_pte+0xa7>
c01044ee:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01044f1:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01044f5:	c7 44 24 08 b4 6e 10 	movl   $0xc0106eb4,0x8(%esp)
c01044fc:	c0 
c01044fd:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
c0104504:	00 
c0104505:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010450c:	e8 7f d1 ff ff       	call   c0101690 <__panic>
c0104511:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104514:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104519:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104520:	00 
c0104521:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104528:	00 
c0104529:	89 04 24             	mov    %eax,(%esp)
c010452c:	e8 06 19 00 00       	call   c0105e37 <memset>
        *pdep = pa | PTE_U | PTE_W | PTE_P;
c0104531:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104534:	89 c2                	mov    %eax,%edx
c0104536:	83 ca 07             	or     $0x7,%edx
c0104539:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010453c:	89 10                	mov    %edx,(%eax)
    }
    return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)];
c010453e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104541:	8b 00                	mov    (%eax),%eax
c0104543:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104548:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010454b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010454e:	c1 e8 0c             	shr    $0xc,%eax
c0104551:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0104554:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0104559:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c010455c:	72 23                	jb     c0104581 <get_pte+0x117>
c010455e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104561:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104565:	c7 44 24 08 b4 6e 10 	movl   $0xc0106eb4,0x8(%esp)
c010456c:	c0 
c010456d:	c7 44 24 04 68 01 00 	movl   $0x168,0x4(%esp)
c0104574:	00 
c0104575:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010457c:	e8 0f d1 ff ff       	call   c0101690 <__panic>
c0104581:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104584:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104589:	8b 55 0c             	mov    0xc(%ebp),%edx
c010458c:	c1 ea 0c             	shr    $0xc,%edx
c010458f:	81 e2 ff 03 00 00    	and    $0x3ff,%edx
c0104595:	c1 e2 02             	shl    $0x2,%edx
c0104598:	01 d0                	add    %edx,%eax
}
c010459a:	c9                   	leave  
c010459b:	c3                   	ret    

c010459c <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c010459c:	55                   	push   %ebp
c010459d:	89 e5                	mov    %esp,%ebp
c010459f:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c01045a2:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01045a9:	00 
c01045aa:	8b 45 0c             	mov    0xc(%ebp),%eax
c01045ad:	89 44 24 04          	mov    %eax,0x4(%esp)
c01045b1:	8b 45 08             	mov    0x8(%ebp),%eax
c01045b4:	89 04 24             	mov    %eax,(%esp)
c01045b7:	e8 ae fe ff ff       	call   c010446a <get_pte>
c01045bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
c01045bf:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01045c3:	74 08                	je     c01045cd <get_page+0x31>
        *ptep_store = ptep;
c01045c5:	8b 45 10             	mov    0x10(%ebp),%eax
c01045c8:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01045cb:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
c01045cd:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01045d1:	74 1b                	je     c01045ee <get_page+0x52>
c01045d3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045d6:	8b 00                	mov    (%eax),%eax
c01045d8:	83 e0 01             	and    $0x1,%eax
c01045db:	84 c0                	test   %al,%al
c01045dd:	74 0f                	je     c01045ee <get_page+0x52>
        return pa2page(*ptep);
c01045df:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045e2:	8b 00                	mov    (%eax),%eax
c01045e4:	89 04 24             	mov    %eax,(%esp)
c01045e7:	e8 28 f4 ff ff       	call   c0103a14 <pa2page>
c01045ec:	eb 05                	jmp    c01045f3 <get_page+0x57>
    }
    return NULL;
c01045ee:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01045f3:	c9                   	leave  
c01045f4:	c3                   	ret    

c01045f5 <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c01045f5:	55                   	push   %ebp
c01045f6:	89 e5                	mov    %esp,%ebp
c01045f8:	83 ec 28             	sub    $0x28,%esp
    if (*ptep & PTE_P) {
c01045fb:	8b 45 10             	mov    0x10(%ebp),%eax
c01045fe:	8b 00                	mov    (%eax),%eax
c0104600:	83 e0 01             	and    $0x1,%eax
c0104603:	84 c0                	test   %al,%al
c0104605:	74 4d                	je     c0104654 <page_remove_pte+0x5f>
        struct Page *page = pte2page(*ptep);
c0104607:	8b 45 10             	mov    0x10(%ebp),%eax
c010460a:	8b 00                	mov    (%eax),%eax
c010460c:	89 04 24             	mov    %eax,(%esp)
c010460f:	e8 99 f4 ff ff       	call   c0103aad <pte2page>
c0104614:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (page_ref_dec(page) == 0) {
c0104617:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010461a:	89 04 24             	mov    %eax,(%esp)
c010461d:	e8 28 f5 ff ff       	call   c0103b4a <page_ref_dec>
c0104622:	85 c0                	test   %eax,%eax
c0104624:	75 13                	jne    c0104639 <page_remove_pte+0x44>
            free_page(page);
c0104626:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010462d:	00 
c010462e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104631:	89 04 24             	mov    %eax,(%esp)
c0104634:	e8 42 f7 ff ff       	call   c0103d7b <free_pages>
        }
        *ptep = 0;
c0104639:	8b 45 10             	mov    0x10(%ebp),%eax
c010463c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        tlb_invalidate(pgdir, la);
c0104642:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104645:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104649:	8b 45 08             	mov    0x8(%ebp),%eax
c010464c:	89 04 24             	mov    %eax,(%esp)
c010464f:	e8 ff 00 00 00       	call   c0104753 <tlb_invalidate>
    }
}
c0104654:	c9                   	leave  
c0104655:	c3                   	ret    

c0104656 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
c0104656:	55                   	push   %ebp
c0104657:	89 e5                	mov    %esp,%ebp
c0104659:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c010465c:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104663:	00 
c0104664:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104667:	89 44 24 04          	mov    %eax,0x4(%esp)
c010466b:	8b 45 08             	mov    0x8(%ebp),%eax
c010466e:	89 04 24             	mov    %eax,(%esp)
c0104671:	e8 f4 fd ff ff       	call   c010446a <get_pte>
c0104676:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep != NULL) {
c0104679:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010467d:	74 19                	je     c0104698 <page_remove+0x42>
        page_remove_pte(pgdir, la, ptep);
c010467f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104682:	89 44 24 08          	mov    %eax,0x8(%esp)
c0104686:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104689:	89 44 24 04          	mov    %eax,0x4(%esp)
c010468d:	8b 45 08             	mov    0x8(%ebp),%eax
c0104690:	89 04 24             	mov    %eax,(%esp)
c0104693:	e8 5d ff ff ff       	call   c01045f5 <page_remove_pte>
    }
}
c0104698:	c9                   	leave  
c0104699:	c3                   	ret    

c010469a <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c010469a:	55                   	push   %ebp
c010469b:	89 e5                	mov    %esp,%ebp
c010469d:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
c01046a0:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c01046a7:	00 
c01046a8:	8b 45 10             	mov    0x10(%ebp),%eax
c01046ab:	89 44 24 04          	mov    %eax,0x4(%esp)
c01046af:	8b 45 08             	mov    0x8(%ebp),%eax
c01046b2:	89 04 24             	mov    %eax,(%esp)
c01046b5:	e8 b0 fd ff ff       	call   c010446a <get_pte>
c01046ba:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (ptep == NULL) {
c01046bd:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01046c1:	75 0a                	jne    c01046cd <page_insert+0x33>
        return -E_NO_MEM;
c01046c3:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c01046c8:	e9 84 00 00 00       	jmp    c0104751 <page_insert+0xb7>
    }
    page_ref_inc(page);
c01046cd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01046d0:	89 04 24             	mov    %eax,(%esp)
c01046d3:	e8 42 f4 ff ff       	call   c0103b1a <page_ref_inc>
    if (*ptep & PTE_P) {
c01046d8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01046db:	8b 00                	mov    (%eax),%eax
c01046dd:	83 e0 01             	and    $0x1,%eax
c01046e0:	84 c0                	test   %al,%al
c01046e2:	74 3e                	je     c0104722 <page_insert+0x88>
        struct Page *p = pte2page(*ptep);
c01046e4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01046e7:	8b 00                	mov    (%eax),%eax
c01046e9:	89 04 24             	mov    %eax,(%esp)
c01046ec:	e8 bc f3 ff ff       	call   c0103aad <pte2page>
c01046f1:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (p == page) {
c01046f4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046f7:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01046fa:	75 0d                	jne    c0104709 <page_insert+0x6f>
            page_ref_dec(page);
c01046fc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01046ff:	89 04 24             	mov    %eax,(%esp)
c0104702:	e8 43 f4 ff ff       	call   c0103b4a <page_ref_dec>
c0104707:	eb 19                	jmp    c0104722 <page_insert+0x88>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
c0104709:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010470c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0104710:	8b 45 10             	mov    0x10(%ebp),%eax
c0104713:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104717:	8b 45 08             	mov    0x8(%ebp),%eax
c010471a:	89 04 24             	mov    %eax,(%esp)
c010471d:	e8 d3 fe ff ff       	call   c01045f5 <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
c0104722:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104725:	89 04 24             	mov    %eax,(%esp)
c0104728:	e8 d1 f2 ff ff       	call   c01039fe <page2pa>
c010472d:	0b 45 14             	or     0x14(%ebp),%eax
c0104730:	89 c2                	mov    %eax,%edx
c0104732:	83 ca 01             	or     $0x1,%edx
c0104735:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104738:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
c010473a:	8b 45 10             	mov    0x10(%ebp),%eax
c010473d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104741:	8b 45 08             	mov    0x8(%ebp),%eax
c0104744:	89 04 24             	mov    %eax,(%esp)
c0104747:	e8 07 00 00 00       	call   c0104753 <tlb_invalidate>
    return 0;
c010474c:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104751:	c9                   	leave  
c0104752:	c3                   	ret    

c0104753 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c0104753:	55                   	push   %ebp
c0104754:	89 e5                	mov    %esp,%ebp
c0104756:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3));
c0104759:	0f 20 d8             	mov    %cr3,%eax
c010475c:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
c010475f:	8b 45 f0             	mov    -0x10(%ebp),%eax
    if (rcr3() == PADDR(pgdir)) {
c0104762:	89 c2                	mov    %eax,%edx
c0104764:	8b 45 08             	mov    0x8(%ebp),%eax
c0104767:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010476a:	81 7d ec ff ff ff bf 	cmpl   $0xbfffffff,-0x14(%ebp)
c0104771:	77 23                	ja     c0104796 <tlb_invalidate+0x43>
c0104773:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104776:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010477a:	c7 44 24 08 54 6f 10 	movl   $0xc0106f54,0x8(%esp)
c0104781:	c0 
c0104782:	c7 44 24 04 b1 01 00 	movl   $0x1b1,0x4(%esp)
c0104789:	00 
c010478a:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104791:	e8 fa ce ff ff       	call   c0101690 <__panic>
c0104796:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104799:	05 00 00 00 40       	add    $0x40000000,%eax
c010479e:	39 c2                	cmp    %eax,%edx
c01047a0:	75 0c                	jne    c01047ae <tlb_invalidate+0x5b>
        invlpg((void *)la);
c01047a2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047a5:	89 45 f4             	mov    %eax,-0xc(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c01047a8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047ab:	0f 01 38             	invlpg (%eax)
    }
}
c01047ae:	c9                   	leave  
c01047af:	c3                   	ret    

c01047b0 <check_alloc_page>:

static void
check_alloc_page(void) {
c01047b0:	55                   	push   %ebp
c01047b1:	89 e5                	mov    %esp,%ebp
c01047b3:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->check();
c01047b6:	a1 d0 a9 11 c0       	mov    0xc011a9d0,%eax
c01047bb:	8b 40 18             	mov    0x18(%eax),%eax
c01047be:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
c01047c0:	c7 04 24 d8 6f 10 c0 	movl   $0xc0106fd8,(%esp)
c01047c7:	e8 e0 b9 ff ff       	call   c01001ac <cprintf>
}
c01047cc:	c9                   	leave  
c01047cd:	c3                   	ret    

c01047ce <check_pgdir>:

static void
check_pgdir(void) {
c01047ce:	55                   	push   %ebp
c01047cf:	89 e5                	mov    %esp,%ebp
c01047d1:	83 ec 38             	sub    $0x38,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
c01047d4:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c01047d9:	3d 00 80 03 00       	cmp    $0x38000,%eax
c01047de:	76 24                	jbe    c0104804 <check_pgdir+0x36>
c01047e0:	c7 44 24 0c f7 6f 10 	movl   $0xc0106ff7,0xc(%esp)
c01047e7:	c0 
c01047e8:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c01047ef:	c0 
c01047f0:	c7 44 24 04 be 01 00 	movl   $0x1be,0x4(%esp)
c01047f7:	00 
c01047f8:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01047ff:	e8 8c ce ff ff       	call   c0101690 <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c0104804:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104809:	85 c0                	test   %eax,%eax
c010480b:	74 0e                	je     c010481b <check_pgdir+0x4d>
c010480d:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104812:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104817:	85 c0                	test   %eax,%eax
c0104819:	74 24                	je     c010483f <check_pgdir+0x71>
c010481b:	c7 44 24 0c 14 70 10 	movl   $0xc0107014,0xc(%esp)
c0104822:	c0 
c0104823:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c010482a:	c0 
c010482b:	c7 44 24 04 bf 01 00 	movl   $0x1bf,0x4(%esp)
c0104832:	00 
c0104833:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010483a:	e8 51 ce ff ff       	call   c0101690 <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c010483f:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104844:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010484b:	00 
c010484c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104853:	00 
c0104854:	89 04 24             	mov    %eax,(%esp)
c0104857:	e8 40 fd ff ff       	call   c010459c <get_page>
c010485c:	85 c0                	test   %eax,%eax
c010485e:	74 24                	je     c0104884 <check_pgdir+0xb6>
c0104860:	c7 44 24 0c 4c 70 10 	movl   $0xc010704c,0xc(%esp)
c0104867:	c0 
c0104868:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c010486f:	c0 
c0104870:	c7 44 24 04 c0 01 00 	movl   $0x1c0,0x4(%esp)
c0104877:	00 
c0104878:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010487f:	e8 0c ce ff ff       	call   c0101690 <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
c0104884:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010488b:	e8 ba f4 ff ff       	call   c0103d4a <alloc_pages>
c0104890:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c0104893:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104898:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c010489f:	00 
c01048a0:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01048a7:	00 
c01048a8:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01048ab:	89 54 24 04          	mov    %edx,0x4(%esp)
c01048af:	89 04 24             	mov    %eax,(%esp)
c01048b2:	e8 e3 fd ff ff       	call   c010469a <page_insert>
c01048b7:	85 c0                	test   %eax,%eax
c01048b9:	74 24                	je     c01048df <check_pgdir+0x111>
c01048bb:	c7 44 24 0c 74 70 10 	movl   $0xc0107074,0xc(%esp)
c01048c2:	c0 
c01048c3:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c01048ca:	c0 
c01048cb:	c7 44 24 04 c4 01 00 	movl   $0x1c4,0x4(%esp)
c01048d2:	00 
c01048d3:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01048da:	e8 b1 cd ff ff       	call   c0101690 <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c01048df:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01048e4:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01048eb:	00 
c01048ec:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01048f3:	00 
c01048f4:	89 04 24             	mov    %eax,(%esp)
c01048f7:	e8 6e fb ff ff       	call   c010446a <get_pte>
c01048fc:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01048ff:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0104903:	75 24                	jne    c0104929 <check_pgdir+0x15b>
c0104905:	c7 44 24 0c a0 70 10 	movl   $0xc01070a0,0xc(%esp)
c010490c:	c0 
c010490d:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104914:	c0 
c0104915:	c7 44 24 04 c7 01 00 	movl   $0x1c7,0x4(%esp)
c010491c:	00 
c010491d:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104924:	e8 67 cd ff ff       	call   c0101690 <__panic>
    assert(pa2page(*ptep) == p1);
c0104929:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010492c:	8b 00                	mov    (%eax),%eax
c010492e:	89 04 24             	mov    %eax,(%esp)
c0104931:	e8 de f0 ff ff       	call   c0103a14 <pa2page>
c0104936:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
c0104939:	74 24                	je     c010495f <check_pgdir+0x191>
c010493b:	c7 44 24 0c cd 70 10 	movl   $0xc01070cd,0xc(%esp)
c0104942:	c0 
c0104943:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c010494a:	c0 
c010494b:	c7 44 24 04 c8 01 00 	movl   $0x1c8,0x4(%esp)
c0104952:	00 
c0104953:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010495a:	e8 31 cd ff ff       	call   c0101690 <__panic>
    assert(page_ref(p1) == 1);
c010495f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104962:	89 04 24             	mov    %eax,(%esp)
c0104965:	e8 81 f1 ff ff       	call   c0103aeb <page_ref>
c010496a:	83 f8 01             	cmp    $0x1,%eax
c010496d:	74 24                	je     c0104993 <check_pgdir+0x1c5>
c010496f:	c7 44 24 0c e2 70 10 	movl   $0xc01070e2,0xc(%esp)
c0104976:	c0 
c0104977:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c010497e:	c0 
c010497f:	c7 44 24 04 c9 01 00 	movl   $0x1c9,0x4(%esp)
c0104986:	00 
c0104987:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010498e:	e8 fd cc ff ff       	call   c0101690 <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
c0104993:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104998:	8b 00                	mov    (%eax),%eax
c010499a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010499f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01049a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01049a5:	c1 e8 0c             	shr    $0xc,%eax
c01049a8:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01049ab:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c01049b0:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01049b3:	72 23                	jb     c01049d8 <check_pgdir+0x20a>
c01049b5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01049b8:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01049bc:	c7 44 24 08 b4 6e 10 	movl   $0xc0106eb4,0x8(%esp)
c01049c3:	c0 
c01049c4:	c7 44 24 04 cb 01 00 	movl   $0x1cb,0x4(%esp)
c01049cb:	00 
c01049cc:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01049d3:	e8 b8 cc ff ff       	call   c0101690 <__panic>
c01049d8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01049db:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01049e0:	83 c0 04             	add    $0x4,%eax
c01049e3:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c01049e6:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01049eb:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01049f2:	00 
c01049f3:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c01049fa:	00 
c01049fb:	89 04 24             	mov    %eax,(%esp)
c01049fe:	e8 67 fa ff ff       	call   c010446a <get_pte>
c0104a03:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0104a06:	74 24                	je     c0104a2c <check_pgdir+0x25e>
c0104a08:	c7 44 24 0c f4 70 10 	movl   $0xc01070f4,0xc(%esp)
c0104a0f:	c0 
c0104a10:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104a17:	c0 
c0104a18:	c7 44 24 04 cc 01 00 	movl   $0x1cc,0x4(%esp)
c0104a1f:	00 
c0104a20:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104a27:	e8 64 cc ff ff       	call   c0101690 <__panic>

    p2 = alloc_page();
c0104a2c:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104a33:	e8 12 f3 ff ff       	call   c0103d4a <alloc_pages>
c0104a38:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0104a3b:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104a40:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
c0104a47:	00 
c0104a48:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104a4f:	00 
c0104a50:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0104a53:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104a57:	89 04 24             	mov    %eax,(%esp)
c0104a5a:	e8 3b fc ff ff       	call   c010469a <page_insert>
c0104a5f:	85 c0                	test   %eax,%eax
c0104a61:	74 24                	je     c0104a87 <check_pgdir+0x2b9>
c0104a63:	c7 44 24 0c 1c 71 10 	movl   $0xc010711c,0xc(%esp)
c0104a6a:	c0 
c0104a6b:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104a72:	c0 
c0104a73:	c7 44 24 04 cf 01 00 	movl   $0x1cf,0x4(%esp)
c0104a7a:	00 
c0104a7b:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104a82:	e8 09 cc ff ff       	call   c0101690 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104a87:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104a8c:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104a93:	00 
c0104a94:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104a9b:	00 
c0104a9c:	89 04 24             	mov    %eax,(%esp)
c0104a9f:	e8 c6 f9 ff ff       	call   c010446a <get_pte>
c0104aa4:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104aa7:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0104aab:	75 24                	jne    c0104ad1 <check_pgdir+0x303>
c0104aad:	c7 44 24 0c 54 71 10 	movl   $0xc0107154,0xc(%esp)
c0104ab4:	c0 
c0104ab5:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104abc:	c0 
c0104abd:	c7 44 24 04 d0 01 00 	movl   $0x1d0,0x4(%esp)
c0104ac4:	00 
c0104ac5:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104acc:	e8 bf cb ff ff       	call   c0101690 <__panic>
    assert(*ptep & PTE_U);
c0104ad1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ad4:	8b 00                	mov    (%eax),%eax
c0104ad6:	83 e0 04             	and    $0x4,%eax
c0104ad9:	85 c0                	test   %eax,%eax
c0104adb:	75 24                	jne    c0104b01 <check_pgdir+0x333>
c0104add:	c7 44 24 0c 84 71 10 	movl   $0xc0107184,0xc(%esp)
c0104ae4:	c0 
c0104ae5:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104aec:	c0 
c0104aed:	c7 44 24 04 d1 01 00 	movl   $0x1d1,0x4(%esp)
c0104af4:	00 
c0104af5:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104afc:	e8 8f cb ff ff       	call   c0101690 <__panic>
    assert(*ptep & PTE_W);
c0104b01:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104b04:	8b 00                	mov    (%eax),%eax
c0104b06:	83 e0 02             	and    $0x2,%eax
c0104b09:	85 c0                	test   %eax,%eax
c0104b0b:	75 24                	jne    c0104b31 <check_pgdir+0x363>
c0104b0d:	c7 44 24 0c 92 71 10 	movl   $0xc0107192,0xc(%esp)
c0104b14:	c0 
c0104b15:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104b1c:	c0 
c0104b1d:	c7 44 24 04 d2 01 00 	movl   $0x1d2,0x4(%esp)
c0104b24:	00 
c0104b25:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104b2c:	e8 5f cb ff ff       	call   c0101690 <__panic>
    assert(boot_pgdir[0] & PTE_U);
c0104b31:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104b36:	8b 00                	mov    (%eax),%eax
c0104b38:	83 e0 04             	and    $0x4,%eax
c0104b3b:	85 c0                	test   %eax,%eax
c0104b3d:	75 24                	jne    c0104b63 <check_pgdir+0x395>
c0104b3f:	c7 44 24 0c a0 71 10 	movl   $0xc01071a0,0xc(%esp)
c0104b46:	c0 
c0104b47:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104b4e:	c0 
c0104b4f:	c7 44 24 04 d3 01 00 	movl   $0x1d3,0x4(%esp)
c0104b56:	00 
c0104b57:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104b5e:	e8 2d cb ff ff       	call   c0101690 <__panic>
    assert(page_ref(p2) == 1);
c0104b63:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104b66:	89 04 24             	mov    %eax,(%esp)
c0104b69:	e8 7d ef ff ff       	call   c0103aeb <page_ref>
c0104b6e:	83 f8 01             	cmp    $0x1,%eax
c0104b71:	74 24                	je     c0104b97 <check_pgdir+0x3c9>
c0104b73:	c7 44 24 0c b6 71 10 	movl   $0xc01071b6,0xc(%esp)
c0104b7a:	c0 
c0104b7b:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104b82:	c0 
c0104b83:	c7 44 24 04 d4 01 00 	movl   $0x1d4,0x4(%esp)
c0104b8a:	00 
c0104b8b:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104b92:	e8 f9 ca ff ff       	call   c0101690 <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c0104b97:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104b9c:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104ba3:	00 
c0104ba4:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104bab:	00 
c0104bac:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104baf:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104bb3:	89 04 24             	mov    %eax,(%esp)
c0104bb6:	e8 df fa ff ff       	call   c010469a <page_insert>
c0104bbb:	85 c0                	test   %eax,%eax
c0104bbd:	74 24                	je     c0104be3 <check_pgdir+0x415>
c0104bbf:	c7 44 24 0c c8 71 10 	movl   $0xc01071c8,0xc(%esp)
c0104bc6:	c0 
c0104bc7:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104bce:	c0 
c0104bcf:	c7 44 24 04 d6 01 00 	movl   $0x1d6,0x4(%esp)
c0104bd6:	00 
c0104bd7:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104bde:	e8 ad ca ff ff       	call   c0101690 <__panic>
    assert(page_ref(p1) == 2);
c0104be3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104be6:	89 04 24             	mov    %eax,(%esp)
c0104be9:	e8 fd ee ff ff       	call   c0103aeb <page_ref>
c0104bee:	83 f8 02             	cmp    $0x2,%eax
c0104bf1:	74 24                	je     c0104c17 <check_pgdir+0x449>
c0104bf3:	c7 44 24 0c f4 71 10 	movl   $0xc01071f4,0xc(%esp)
c0104bfa:	c0 
c0104bfb:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104c02:	c0 
c0104c03:	c7 44 24 04 d7 01 00 	movl   $0x1d7,0x4(%esp)
c0104c0a:	00 
c0104c0b:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104c12:	e8 79 ca ff ff       	call   c0101690 <__panic>
    assert(page_ref(p2) == 0);
c0104c17:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104c1a:	89 04 24             	mov    %eax,(%esp)
c0104c1d:	e8 c9 ee ff ff       	call   c0103aeb <page_ref>
c0104c22:	85 c0                	test   %eax,%eax
c0104c24:	74 24                	je     c0104c4a <check_pgdir+0x47c>
c0104c26:	c7 44 24 0c 06 72 10 	movl   $0xc0107206,0xc(%esp)
c0104c2d:	c0 
c0104c2e:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104c35:	c0 
c0104c36:	c7 44 24 04 d8 01 00 	movl   $0x1d8,0x4(%esp)
c0104c3d:	00 
c0104c3e:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104c45:	e8 46 ca ff ff       	call   c0101690 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104c4a:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104c4f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104c56:	00 
c0104c57:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104c5e:	00 
c0104c5f:	89 04 24             	mov    %eax,(%esp)
c0104c62:	e8 03 f8 ff ff       	call   c010446a <get_pte>
c0104c67:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104c6a:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0104c6e:	75 24                	jne    c0104c94 <check_pgdir+0x4c6>
c0104c70:	c7 44 24 0c 54 71 10 	movl   $0xc0107154,0xc(%esp)
c0104c77:	c0 
c0104c78:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104c7f:	c0 
c0104c80:	c7 44 24 04 d9 01 00 	movl   $0x1d9,0x4(%esp)
c0104c87:	00 
c0104c88:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104c8f:	e8 fc c9 ff ff       	call   c0101690 <__panic>
    assert(pa2page(*ptep) == p1);
c0104c94:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104c97:	8b 00                	mov    (%eax),%eax
c0104c99:	89 04 24             	mov    %eax,(%esp)
c0104c9c:	e8 73 ed ff ff       	call   c0103a14 <pa2page>
c0104ca1:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
c0104ca4:	74 24                	je     c0104cca <check_pgdir+0x4fc>
c0104ca6:	c7 44 24 0c cd 70 10 	movl   $0xc01070cd,0xc(%esp)
c0104cad:	c0 
c0104cae:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104cb5:	c0 
c0104cb6:	c7 44 24 04 da 01 00 	movl   $0x1da,0x4(%esp)
c0104cbd:	00 
c0104cbe:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104cc5:	e8 c6 c9 ff ff       	call   c0101690 <__panic>
    assert((*ptep & PTE_U) == 0);
c0104cca:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ccd:	8b 00                	mov    (%eax),%eax
c0104ccf:	83 e0 04             	and    $0x4,%eax
c0104cd2:	85 c0                	test   %eax,%eax
c0104cd4:	74 24                	je     c0104cfa <check_pgdir+0x52c>
c0104cd6:	c7 44 24 0c 18 72 10 	movl   $0xc0107218,0xc(%esp)
c0104cdd:	c0 
c0104cde:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104ce5:	c0 
c0104ce6:	c7 44 24 04 db 01 00 	movl   $0x1db,0x4(%esp)
c0104ced:	00 
c0104cee:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104cf5:	e8 96 c9 ff ff       	call   c0101690 <__panic>

    page_remove(boot_pgdir, 0x0);
c0104cfa:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104cff:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104d06:	00 
c0104d07:	89 04 24             	mov    %eax,(%esp)
c0104d0a:	e8 47 f9 ff ff       	call   c0104656 <page_remove>
    assert(page_ref(p1) == 1);
c0104d0f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104d12:	89 04 24             	mov    %eax,(%esp)
c0104d15:	e8 d1 ed ff ff       	call   c0103aeb <page_ref>
c0104d1a:	83 f8 01             	cmp    $0x1,%eax
c0104d1d:	74 24                	je     c0104d43 <check_pgdir+0x575>
c0104d1f:	c7 44 24 0c e2 70 10 	movl   $0xc01070e2,0xc(%esp)
c0104d26:	c0 
c0104d27:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104d2e:	c0 
c0104d2f:	c7 44 24 04 de 01 00 	movl   $0x1de,0x4(%esp)
c0104d36:	00 
c0104d37:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104d3e:	e8 4d c9 ff ff       	call   c0101690 <__panic>
    assert(page_ref(p2) == 0);
c0104d43:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104d46:	89 04 24             	mov    %eax,(%esp)
c0104d49:	e8 9d ed ff ff       	call   c0103aeb <page_ref>
c0104d4e:	85 c0                	test   %eax,%eax
c0104d50:	74 24                	je     c0104d76 <check_pgdir+0x5a8>
c0104d52:	c7 44 24 0c 06 72 10 	movl   $0xc0107206,0xc(%esp)
c0104d59:	c0 
c0104d5a:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104d61:	c0 
c0104d62:	c7 44 24 04 df 01 00 	movl   $0x1df,0x4(%esp)
c0104d69:	00 
c0104d6a:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104d71:	e8 1a c9 ff ff       	call   c0101690 <__panic>

    page_remove(boot_pgdir, PGSIZE);
c0104d76:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104d7b:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104d82:	00 
c0104d83:	89 04 24             	mov    %eax,(%esp)
c0104d86:	e8 cb f8 ff ff       	call   c0104656 <page_remove>
    assert(page_ref(p1) == 0);
c0104d8b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104d8e:	89 04 24             	mov    %eax,(%esp)
c0104d91:	e8 55 ed ff ff       	call   c0103aeb <page_ref>
c0104d96:	85 c0                	test   %eax,%eax
c0104d98:	74 24                	je     c0104dbe <check_pgdir+0x5f0>
c0104d9a:	c7 44 24 0c 2d 72 10 	movl   $0xc010722d,0xc(%esp)
c0104da1:	c0 
c0104da2:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104da9:	c0 
c0104daa:	c7 44 24 04 e2 01 00 	movl   $0x1e2,0x4(%esp)
c0104db1:	00 
c0104db2:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104db9:	e8 d2 c8 ff ff       	call   c0101690 <__panic>
    assert(page_ref(p2) == 0);
c0104dbe:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104dc1:	89 04 24             	mov    %eax,(%esp)
c0104dc4:	e8 22 ed ff ff       	call   c0103aeb <page_ref>
c0104dc9:	85 c0                	test   %eax,%eax
c0104dcb:	74 24                	je     c0104df1 <check_pgdir+0x623>
c0104dcd:	c7 44 24 0c 06 72 10 	movl   $0xc0107206,0xc(%esp)
c0104dd4:	c0 
c0104dd5:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104ddc:	c0 
c0104ddd:	c7 44 24 04 e3 01 00 	movl   $0x1e3,0x4(%esp)
c0104de4:	00 
c0104de5:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104dec:	e8 9f c8 ff ff       	call   c0101690 <__panic>

    assert(page_ref(pa2page(boot_pgdir[0])) == 1);
c0104df1:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104df6:	8b 00                	mov    (%eax),%eax
c0104df8:	89 04 24             	mov    %eax,(%esp)
c0104dfb:	e8 14 ec ff ff       	call   c0103a14 <pa2page>
c0104e00:	89 04 24             	mov    %eax,(%esp)
c0104e03:	e8 e3 ec ff ff       	call   c0103aeb <page_ref>
c0104e08:	83 f8 01             	cmp    $0x1,%eax
c0104e0b:	74 24                	je     c0104e31 <check_pgdir+0x663>
c0104e0d:	c7 44 24 0c 40 72 10 	movl   $0xc0107240,0xc(%esp)
c0104e14:	c0 
c0104e15:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104e1c:	c0 
c0104e1d:	c7 44 24 04 e5 01 00 	movl   $0x1e5,0x4(%esp)
c0104e24:	00 
c0104e25:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104e2c:	e8 5f c8 ff ff       	call   c0101690 <__panic>
    free_page(pa2page(boot_pgdir[0]));
c0104e31:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104e36:	8b 00                	mov    (%eax),%eax
c0104e38:	89 04 24             	mov    %eax,(%esp)
c0104e3b:	e8 d4 eb ff ff       	call   c0103a14 <pa2page>
c0104e40:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104e47:	00 
c0104e48:	89 04 24             	mov    %eax,(%esp)
c0104e4b:	e8 2b ef ff ff       	call   c0103d7b <free_pages>
    boot_pgdir[0] = 0;
c0104e50:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104e55:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
c0104e5b:	c7 04 24 66 72 10 c0 	movl   $0xc0107266,(%esp)
c0104e62:	e8 45 b3 ff ff       	call   c01001ac <cprintf>
}
c0104e67:	c9                   	leave  
c0104e68:	c3                   	ret    

c0104e69 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
c0104e69:	55                   	push   %ebp
c0104e6a:	89 e5                	mov    %esp,%ebp
c0104e6c:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
c0104e6f:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c0104e76:	e9 cb 00 00 00       	jmp    c0104f46 <check_boot_pgdir+0xdd>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c0104e7b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104e7e:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104e81:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104e84:	c1 e8 0c             	shr    $0xc,%eax
c0104e87:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104e8a:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0104e8f:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0104e92:	72 23                	jb     c0104eb7 <check_boot_pgdir+0x4e>
c0104e94:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104e97:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104e9b:	c7 44 24 08 b4 6e 10 	movl   $0xc0106eb4,0x8(%esp)
c0104ea2:	c0 
c0104ea3:	c7 44 24 04 f1 01 00 	movl   $0x1f1,0x4(%esp)
c0104eaa:	00 
c0104eab:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104eb2:	e8 d9 c7 ff ff       	call   c0101690 <__panic>
c0104eb7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104eba:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104ebf:	89 c2                	mov    %eax,%edx
c0104ec1:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104ec6:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104ecd:	00 
c0104ece:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104ed2:	89 04 24             	mov    %eax,(%esp)
c0104ed5:	e8 90 f5 ff ff       	call   c010446a <get_pte>
c0104eda:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0104edd:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0104ee1:	75 24                	jne    c0104f07 <check_boot_pgdir+0x9e>
c0104ee3:	c7 44 24 0c 80 72 10 	movl   $0xc0107280,0xc(%esp)
c0104eea:	c0 
c0104eeb:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104ef2:	c0 
c0104ef3:	c7 44 24 04 f1 01 00 	movl   $0x1f1,0x4(%esp)
c0104efa:	00 
c0104efb:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104f02:	e8 89 c7 ff ff       	call   c0101690 <__panic>
        assert(PTE_ADDR(*ptep) == i);
c0104f07:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104f0a:	8b 00                	mov    (%eax),%eax
c0104f0c:	89 c2                	mov    %eax,%edx
c0104f0e:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
c0104f14:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104f17:	39 c2                	cmp    %eax,%edx
c0104f19:	74 24                	je     c0104f3f <check_boot_pgdir+0xd6>
c0104f1b:	c7 44 24 0c bd 72 10 	movl   $0xc01072bd,0xc(%esp)
c0104f22:	c0 
c0104f23:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104f2a:	c0 
c0104f2b:	c7 44 24 04 f2 01 00 	movl   $0x1f2,0x4(%esp)
c0104f32:	00 
c0104f33:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104f3a:	e8 51 c7 ff ff       	call   c0101690 <__panic>

static void
check_boot_pgdir(void) {
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
c0104f3f:	81 45 e0 00 10 00 00 	addl   $0x1000,-0x20(%ebp)
c0104f46:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0104f49:	a1 40 a9 11 c0       	mov    0xc011a940,%eax
c0104f4e:	39 c2                	cmp    %eax,%edx
c0104f50:	0f 82 25 ff ff ff    	jb     c0104e7b <check_boot_pgdir+0x12>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
        assert(PTE_ADDR(*ptep) == i);
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c0104f56:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104f5b:	05 ac 0f 00 00       	add    $0xfac,%eax
c0104f60:	8b 00                	mov    (%eax),%eax
c0104f62:	89 c2                	mov    %eax,%edx
c0104f64:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
c0104f6a:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104f6f:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0104f72:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0104f79:	77 23                	ja     c0104f9e <check_boot_pgdir+0x135>
c0104f7b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f7e:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104f82:	c7 44 24 08 54 6f 10 	movl   $0xc0106f54,0x8(%esp)
c0104f89:	c0 
c0104f8a:	c7 44 24 04 f5 01 00 	movl   $0x1f5,0x4(%esp)
c0104f91:	00 
c0104f92:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104f99:	e8 f2 c6 ff ff       	call   c0101690 <__panic>
c0104f9e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104fa1:	05 00 00 00 40       	add    $0x40000000,%eax
c0104fa6:	39 c2                	cmp    %eax,%edx
c0104fa8:	74 24                	je     c0104fce <check_boot_pgdir+0x165>
c0104faa:	c7 44 24 0c d4 72 10 	movl   $0xc01072d4,0xc(%esp)
c0104fb1:	c0 
c0104fb2:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104fb9:	c0 
c0104fba:	c7 44 24 04 f5 01 00 	movl   $0x1f5,0x4(%esp)
c0104fc1:	00 
c0104fc2:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104fc9:	e8 c2 c6 ff ff       	call   c0101690 <__panic>

    assert(boot_pgdir[0] == 0);
c0104fce:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0104fd3:	8b 00                	mov    (%eax),%eax
c0104fd5:	85 c0                	test   %eax,%eax
c0104fd7:	74 24                	je     c0104ffd <check_boot_pgdir+0x194>
c0104fd9:	c7 44 24 0c 08 73 10 	movl   $0xc0107308,0xc(%esp)
c0104fe0:	c0 
c0104fe1:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0104fe8:	c0 
c0104fe9:	c7 44 24 04 f7 01 00 	movl   $0x1f7,0x4(%esp)
c0104ff0:	00 
c0104ff1:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0104ff8:	e8 93 c6 ff ff       	call   c0101690 <__panic>

    struct Page *p;
    p = alloc_page();
c0104ffd:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0105004:	e8 41 ed ff ff       	call   c0103d4a <alloc_pages>
c0105009:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c010500c:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0105011:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105018:	00 
c0105019:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
c0105020:	00 
c0105021:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105024:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105028:	89 04 24             	mov    %eax,(%esp)
c010502b:	e8 6a f6 ff ff       	call   c010469a <page_insert>
c0105030:	85 c0                	test   %eax,%eax
c0105032:	74 24                	je     c0105058 <check_boot_pgdir+0x1ef>
c0105034:	c7 44 24 0c 1c 73 10 	movl   $0xc010731c,0xc(%esp)
c010503b:	c0 
c010503c:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0105043:	c0 
c0105044:	c7 44 24 04 fb 01 00 	movl   $0x1fb,0x4(%esp)
c010504b:	00 
c010504c:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0105053:	e8 38 c6 ff ff       	call   c0101690 <__panic>
    assert(page_ref(p) == 1);
c0105058:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010505b:	89 04 24             	mov    %eax,(%esp)
c010505e:	e8 88 ea ff ff       	call   c0103aeb <page_ref>
c0105063:	83 f8 01             	cmp    $0x1,%eax
c0105066:	74 24                	je     c010508c <check_boot_pgdir+0x223>
c0105068:	c7 44 24 0c 4a 73 10 	movl   $0xc010734a,0xc(%esp)
c010506f:	c0 
c0105070:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0105077:	c0 
c0105078:	c7 44 24 04 fc 01 00 	movl   $0x1fc,0x4(%esp)
c010507f:	00 
c0105080:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0105087:	e8 04 c6 ff ff       	call   c0101690 <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c010508c:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c0105091:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105098:	00 
c0105099:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
c01050a0:	00 
c01050a1:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01050a4:	89 54 24 04          	mov    %edx,0x4(%esp)
c01050a8:	89 04 24             	mov    %eax,(%esp)
c01050ab:	e8 ea f5 ff ff       	call   c010469a <page_insert>
c01050b0:	85 c0                	test   %eax,%eax
c01050b2:	74 24                	je     c01050d8 <check_boot_pgdir+0x26f>
c01050b4:	c7 44 24 0c 5c 73 10 	movl   $0xc010735c,0xc(%esp)
c01050bb:	c0 
c01050bc:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c01050c3:	c0 
c01050c4:	c7 44 24 04 fd 01 00 	movl   $0x1fd,0x4(%esp)
c01050cb:	00 
c01050cc:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01050d3:	e8 b8 c5 ff ff       	call   c0101690 <__panic>
    assert(page_ref(p) == 2);
c01050d8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01050db:	89 04 24             	mov    %eax,(%esp)
c01050de:	e8 08 ea ff ff       	call   c0103aeb <page_ref>
c01050e3:	83 f8 02             	cmp    $0x2,%eax
c01050e6:	74 24                	je     c010510c <check_boot_pgdir+0x2a3>
c01050e8:	c7 44 24 0c 93 73 10 	movl   $0xc0107393,0xc(%esp)
c01050ef:	c0 
c01050f0:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c01050f7:	c0 
c01050f8:	c7 44 24 04 fe 01 00 	movl   $0x1fe,0x4(%esp)
c01050ff:	00 
c0105100:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c0105107:	e8 84 c5 ff ff       	call   c0101690 <__panic>

    const char *str = "ucore: Hello world!!";
c010510c:	c7 45 e8 a4 73 10 c0 	movl   $0xc01073a4,-0x18(%ebp)
    strcpy((void *)0x100, str);
c0105113:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105116:	89 44 24 04          	mov    %eax,0x4(%esp)
c010511a:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105121:	e8 3c 0a 00 00       	call   c0105b62 <strcpy>
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c0105126:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
c010512d:	00 
c010512e:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105135:	e8 a1 0a 00 00       	call   c0105bdb <strcmp>
c010513a:	85 c0                	test   %eax,%eax
c010513c:	74 24                	je     c0105162 <check_boot_pgdir+0x2f9>
c010513e:	c7 44 24 0c bc 73 10 	movl   $0xc01073bc,0xc(%esp)
c0105145:	c0 
c0105146:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c010514d:	c0 
c010514e:	c7 44 24 04 02 02 00 	movl   $0x202,0x4(%esp)
c0105155:	00 
c0105156:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c010515d:	e8 2e c5 ff ff       	call   c0101690 <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
c0105162:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105165:	89 04 24             	mov    %eax,(%esp)
c0105168:	e8 ec e8 ff ff       	call   c0103a59 <page2kva>
c010516d:	05 00 01 00 00       	add    $0x100,%eax
c0105172:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
c0105175:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c010517c:	e8 83 09 00 00       	call   c0105b04 <strlen>
c0105181:	85 c0                	test   %eax,%eax
c0105183:	74 24                	je     c01051a9 <check_boot_pgdir+0x340>
c0105185:	c7 44 24 0c f4 73 10 	movl   $0xc01073f4,0xc(%esp)
c010518c:	c0 
c010518d:	c7 44 24 08 9d 6f 10 	movl   $0xc0106f9d,0x8(%esp)
c0105194:	c0 
c0105195:	c7 44 24 04 05 02 00 	movl   $0x205,0x4(%esp)
c010519c:	00 
c010519d:	c7 04 24 78 6f 10 c0 	movl   $0xc0106f78,(%esp)
c01051a4:	e8 e7 c4 ff ff       	call   c0101690 <__panic>

    free_page(p);
c01051a9:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01051b0:	00 
c01051b1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01051b4:	89 04 24             	mov    %eax,(%esp)
c01051b7:	e8 bf eb ff ff       	call   c0103d7b <free_pages>
    free_page(pa2page(PDE_ADDR(boot_pgdir[0])));
c01051bc:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01051c1:	8b 00                	mov    (%eax),%eax
c01051c3:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01051c8:	89 04 24             	mov    %eax,(%esp)
c01051cb:	e8 44 e8 ff ff       	call   c0103a14 <pa2page>
c01051d0:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01051d7:	00 
c01051d8:	89 04 24             	mov    %eax,(%esp)
c01051db:	e8 9b eb ff ff       	call   c0103d7b <free_pages>
    boot_pgdir[0] = 0;
c01051e0:	a1 44 a9 11 c0       	mov    0xc011a944,%eax
c01051e5:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
c01051eb:	c7 04 24 18 74 10 c0 	movl   $0xc0107418,(%esp)
c01051f2:	e8 b5 af ff ff       	call   c01001ac <cprintf>
}
c01051f7:	c9                   	leave  
c01051f8:	c3                   	ret    

c01051f9 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
c01051f9:	55                   	push   %ebp
c01051fa:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
c01051fc:	8b 45 08             	mov    0x8(%ebp),%eax
c01051ff:	83 e0 04             	and    $0x4,%eax
c0105202:	85 c0                	test   %eax,%eax
c0105204:	74 07                	je     c010520d <perm2str+0x14>
c0105206:	b8 75 00 00 00       	mov    $0x75,%eax
c010520b:	eb 05                	jmp    c0105212 <perm2str+0x19>
c010520d:	b8 2d 00 00 00       	mov    $0x2d,%eax
c0105212:	a2 c8 a9 11 c0       	mov    %al,0xc011a9c8
    str[1] = 'r';
c0105217:	c6 05 c9 a9 11 c0 72 	movb   $0x72,0xc011a9c9
    str[2] = (perm & PTE_W) ? 'w' : '-';
c010521e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105221:	83 e0 02             	and    $0x2,%eax
c0105224:	85 c0                	test   %eax,%eax
c0105226:	74 07                	je     c010522f <perm2str+0x36>
c0105228:	b8 77 00 00 00       	mov    $0x77,%eax
c010522d:	eb 05                	jmp    c0105234 <perm2str+0x3b>
c010522f:	b8 2d 00 00 00       	mov    $0x2d,%eax
c0105234:	a2 ca a9 11 c0       	mov    %al,0xc011a9ca
    str[3] = '\0';
c0105239:	c6 05 cb a9 11 c0 00 	movb   $0x0,0xc011a9cb
    return str;
c0105240:	b8 c8 a9 11 c0       	mov    $0xc011a9c8,%eax
}
c0105245:	5d                   	pop    %ebp
c0105246:	c3                   	ret    

c0105247 <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
c0105247:	55                   	push   %ebp
c0105248:	89 e5                	mov    %esp,%ebp
c010524a:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
c010524d:	8b 45 10             	mov    0x10(%ebp),%eax
c0105250:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105253:	72 0e                	jb     c0105263 <get_pgtable_items+0x1c>
        return 0;
c0105255:	b8 00 00 00 00       	mov    $0x0,%eax
c010525a:	e9 86 00 00 00       	jmp    c01052e5 <get_pgtable_items+0x9e>
    }
    while (start < right && !(table[start] & PTE_P)) {
        start ++;
c010525f:	83 45 10 01          	addl   $0x1,0x10(%ebp)
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
    if (start >= right) {
        return 0;
    }
    while (start < right && !(table[start] & PTE_P)) {
c0105263:	8b 45 10             	mov    0x10(%ebp),%eax
c0105266:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105269:	73 12                	jae    c010527d <get_pgtable_items+0x36>
c010526b:	8b 45 10             	mov    0x10(%ebp),%eax
c010526e:	c1 e0 02             	shl    $0x2,%eax
c0105271:	03 45 14             	add    0x14(%ebp),%eax
c0105274:	8b 00                	mov    (%eax),%eax
c0105276:	83 e0 01             	and    $0x1,%eax
c0105279:	85 c0                	test   %eax,%eax
c010527b:	74 e2                	je     c010525f <get_pgtable_items+0x18>
        start ++;
    }
    if (start < right) {
c010527d:	8b 45 10             	mov    0x10(%ebp),%eax
c0105280:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105283:	73 5b                	jae    c01052e0 <get_pgtable_items+0x99>
        if (left_store != NULL) {
c0105285:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c0105289:	74 08                	je     c0105293 <get_pgtable_items+0x4c>
            *left_store = start;
c010528b:	8b 45 18             	mov    0x18(%ebp),%eax
c010528e:	8b 55 10             	mov    0x10(%ebp),%edx
c0105291:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
c0105293:	8b 45 10             	mov    0x10(%ebp),%eax
c0105296:	c1 e0 02             	shl    $0x2,%eax
c0105299:	03 45 14             	add    0x14(%ebp),%eax
c010529c:	8b 00                	mov    (%eax),%eax
c010529e:	83 e0 07             	and    $0x7,%eax
c01052a1:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01052a4:	83 45 10 01          	addl   $0x1,0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c01052a8:	eb 04                	jmp    c01052ae <get_pgtable_items+0x67>
            start ++;
c01052aa:	83 45 10 01          	addl   $0x1,0x10(%ebp)
    if (start < right) {
        if (left_store != NULL) {
            *left_store = start;
        }
        int perm = (table[start ++] & PTE_USER);
        while (start < right && (table[start] & PTE_USER) == perm) {
c01052ae:	8b 45 10             	mov    0x10(%ebp),%eax
c01052b1:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01052b4:	73 17                	jae    c01052cd <get_pgtable_items+0x86>
c01052b6:	8b 45 10             	mov    0x10(%ebp),%eax
c01052b9:	c1 e0 02             	shl    $0x2,%eax
c01052bc:	03 45 14             	add    0x14(%ebp),%eax
c01052bf:	8b 00                	mov    (%eax),%eax
c01052c1:	89 c2                	mov    %eax,%edx
c01052c3:	83 e2 07             	and    $0x7,%edx
c01052c6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01052c9:	39 c2                	cmp    %eax,%edx
c01052cb:	74 dd                	je     c01052aa <get_pgtable_items+0x63>
            start ++;
        }
        if (right_store != NULL) {
c01052cd:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c01052d1:	74 08                	je     c01052db <get_pgtable_items+0x94>
            *right_store = start;
c01052d3:	8b 45 1c             	mov    0x1c(%ebp),%eax
c01052d6:	8b 55 10             	mov    0x10(%ebp),%edx
c01052d9:	89 10                	mov    %edx,(%eax)
        }
        return perm;
c01052db:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01052de:	eb 05                	jmp    c01052e5 <get_pgtable_items+0x9e>
    }
    return 0;
c01052e0:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01052e5:	c9                   	leave  
c01052e6:	c3                   	ret    

c01052e7 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
c01052e7:	55                   	push   %ebp
c01052e8:	89 e5                	mov    %esp,%ebp
c01052ea:	57                   	push   %edi
c01052eb:	56                   	push   %esi
c01052ec:	53                   	push   %ebx
c01052ed:	83 ec 5c             	sub    $0x5c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
c01052f0:	c7 04 24 38 74 10 c0 	movl   $0xc0107438,(%esp)
c01052f7:	e8 b0 ae ff ff       	call   c01001ac <cprintf>
    size_t left, right = 0, perm;
c01052fc:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c0105303:	e9 0b 01 00 00       	jmp    c0105413 <print_pgdir+0x12c>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c0105308:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010530b:	89 04 24             	mov    %eax,(%esp)
c010530e:	e8 e6 fe ff ff       	call   c01051f9 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c0105313:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0105316:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105319:	89 cb                	mov    %ecx,%ebx
c010531b:	29 d3                	sub    %edx,%ebx
c010531d:	89 da                	mov    %ebx,%edx
void
print_pgdir(void) {
    cprintf("-------------------- BEGIN --------------------\n");
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c010531f:	89 d6                	mov    %edx,%esi
c0105321:	c1 e6 16             	shl    $0x16,%esi
c0105324:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105327:	89 d3                	mov    %edx,%ebx
c0105329:	c1 e3 16             	shl    $0x16,%ebx
c010532c:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010532f:	89 d1                	mov    %edx,%ecx
c0105331:	c1 e1 16             	shl    $0x16,%ecx
c0105334:	8b 7d dc             	mov    -0x24(%ebp),%edi
c0105337:	89 7d c4             	mov    %edi,-0x3c(%ebp)
c010533a:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010533d:	8b 7d c4             	mov    -0x3c(%ebp),%edi
c0105340:	29 d7                	sub    %edx,%edi
c0105342:	89 fa                	mov    %edi,%edx
c0105344:	89 44 24 14          	mov    %eax,0x14(%esp)
c0105348:	89 74 24 10          	mov    %esi,0x10(%esp)
c010534c:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105350:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0105354:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105358:	c7 04 24 69 74 10 c0 	movl   $0xc0107469,(%esp)
c010535f:	e8 48 ae ff ff       	call   c01001ac <cprintf>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
c0105364:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105367:	c1 e0 0a             	shl    $0xa,%eax
c010536a:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c010536d:	eb 5c                	jmp    c01053cb <print_pgdir+0xe4>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c010536f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105372:	89 04 24             	mov    %eax,(%esp)
c0105375:	e8 7f fe ff ff       	call   c01051f9 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c010537a:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c010537d:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105380:	89 cb                	mov    %ecx,%ebx
c0105382:	29 d3                	sub    %edx,%ebx
c0105384:	89 da                	mov    %ebx,%edx
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c0105386:	89 d6                	mov    %edx,%esi
c0105388:	c1 e6 0c             	shl    $0xc,%esi
c010538b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010538e:	89 d3                	mov    %edx,%ebx
c0105390:	c1 e3 0c             	shl    $0xc,%ebx
c0105393:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105396:	89 d1                	mov    %edx,%ecx
c0105398:	c1 e1 0c             	shl    $0xc,%ecx
c010539b:	8b 7d d4             	mov    -0x2c(%ebp),%edi
c010539e:	89 7d c4             	mov    %edi,-0x3c(%ebp)
c01053a1:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01053a4:	8b 7d c4             	mov    -0x3c(%ebp),%edi
c01053a7:	29 d7                	sub    %edx,%edi
c01053a9:	89 fa                	mov    %edi,%edx
c01053ab:	89 44 24 14          	mov    %eax,0x14(%esp)
c01053af:	89 74 24 10          	mov    %esi,0x10(%esp)
c01053b3:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c01053b7:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c01053bb:	89 54 24 04          	mov    %edx,0x4(%esp)
c01053bf:	c7 04 24 88 74 10 c0 	movl   $0xc0107488,(%esp)
c01053c6:	e8 e1 ad ff ff       	call   c01001ac <cprintf>
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
        size_t l, r = left * NPTEENTRY;
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c01053cb:	8b 15 fc 6e 10 c0    	mov    0xc0106efc,%edx
c01053d1:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01053d4:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c01053d7:	89 ce                	mov    %ecx,%esi
c01053d9:	c1 e6 0a             	shl    $0xa,%esi
c01053dc:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c01053df:	89 cb                	mov    %ecx,%ebx
c01053e1:	c1 e3 0a             	shl    $0xa,%ebx
c01053e4:	8d 4d d4             	lea    -0x2c(%ebp),%ecx
c01053e7:	89 4c 24 14          	mov    %ecx,0x14(%esp)
c01053eb:	8d 4d d8             	lea    -0x28(%ebp),%ecx
c01053ee:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c01053f2:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01053f6:	89 44 24 08          	mov    %eax,0x8(%esp)
c01053fa:	89 74 24 04          	mov    %esi,0x4(%esp)
c01053fe:	89 1c 24             	mov    %ebx,(%esp)
c0105401:	e8 41 fe ff ff       	call   c0105247 <get_pgtable_items>
c0105406:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105409:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010540d:	0f 85 5c ff ff ff    	jne    c010536f <print_pgdir+0x88>
//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
    cprintf("-------------------- BEGIN --------------------\n");
    size_t left, right = 0, perm;
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c0105413:	8b 15 00 6f 10 c0    	mov    0xc0106f00,%edx
c0105419:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010541c:	8d 4d dc             	lea    -0x24(%ebp),%ecx
c010541f:	89 4c 24 14          	mov    %ecx,0x14(%esp)
c0105423:	8d 4d e0             	lea    -0x20(%ebp),%ecx
c0105426:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010542a:	89 54 24 0c          	mov    %edx,0xc(%esp)
c010542e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105432:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
c0105439:	00 
c010543a:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0105441:	e8 01 fe ff ff       	call   c0105247 <get_pgtable_items>
c0105446:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105449:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010544d:	0f 85 b5 fe ff ff    	jne    c0105308 <print_pgdir+0x21>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
        }
    }
    cprintf("--------------------- END ---------------------\n");
c0105453:	c7 04 24 ac 74 10 c0 	movl   $0xc01074ac,(%esp)
c010545a:	e8 4d ad ff ff       	call   c01001ac <cprintf>
}
c010545f:	83 c4 5c             	add    $0x5c,%esp
c0105462:	5b                   	pop    %ebx
c0105463:	5e                   	pop    %esi
c0105464:	5f                   	pop    %edi
c0105465:	5d                   	pop    %ebp
c0105466:	c3                   	ret    
	...

c0105468 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
c0105468:	55                   	push   %ebp
c0105469:	89 e5                	mov    %esp,%ebp
c010546b:	83 ec 58             	sub    $0x58,%esp
c010546e:	8b 45 10             	mov    0x10(%ebp),%eax
c0105471:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0105474:	8b 45 14             	mov    0x14(%ebp),%eax
c0105477:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
c010547a:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010547d:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105480:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0105483:	89 55 dc             	mov    %edx,-0x24(%ebp)
    unsigned mod = do_div(result, base);
c0105486:	8b 45 18             	mov    0x18(%ebp),%eax
c0105489:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010548c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010548f:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105492:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105495:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0105498:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010549b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c010549e:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01054a2:	74 1c                	je     c01054c0 <printnum+0x58>
c01054a4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01054a7:	ba 00 00 00 00       	mov    $0x0,%edx
c01054ac:	f7 75 f4             	divl   -0xc(%ebp)
c01054af:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c01054b2:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01054b5:	ba 00 00 00 00       	mov    $0x0,%edx
c01054ba:	f7 75 f4             	divl   -0xc(%ebp)
c01054bd:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01054c0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01054c3:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01054c6:	f7 75 f4             	divl   -0xc(%ebp)
c01054c9:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01054cc:	89 55 f0             	mov    %edx,-0x10(%ebp)
c01054cf:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01054d2:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01054d5:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01054d8:	89 55 dc             	mov    %edx,-0x24(%ebp)
c01054db:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01054de:	89 45 e0             	mov    %eax,-0x20(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
c01054e1:	8b 45 18             	mov    0x18(%ebp),%eax
c01054e4:	ba 00 00 00 00       	mov    $0x0,%edx
c01054e9:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c01054ec:	77 56                	ja     c0105544 <printnum+0xdc>
c01054ee:	3b 55 d4             	cmp    -0x2c(%ebp),%edx
c01054f1:	72 05                	jb     c01054f8 <printnum+0x90>
c01054f3:	3b 45 d0             	cmp    -0x30(%ebp),%eax
c01054f6:	77 4c                	ja     c0105544 <printnum+0xdc>
        printnum(putch, putdat, result, base, width - 1, padc);
c01054f8:	8b 45 1c             	mov    0x1c(%ebp),%eax
c01054fb:	8d 50 ff             	lea    -0x1(%eax),%edx
c01054fe:	8b 45 20             	mov    0x20(%ebp),%eax
c0105501:	89 44 24 18          	mov    %eax,0x18(%esp)
c0105505:	89 54 24 14          	mov    %edx,0x14(%esp)
c0105509:	8b 45 18             	mov    0x18(%ebp),%eax
c010550c:	89 44 24 10          	mov    %eax,0x10(%esp)
c0105510:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105513:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105516:	89 44 24 08          	mov    %eax,0x8(%esp)
c010551a:	89 54 24 0c          	mov    %edx,0xc(%esp)
c010551e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105521:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105525:	8b 45 08             	mov    0x8(%ebp),%eax
c0105528:	89 04 24             	mov    %eax,(%esp)
c010552b:	e8 38 ff ff ff       	call   c0105468 <printnum>
c0105530:	eb 1c                	jmp    c010554e <printnum+0xe6>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
c0105532:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105535:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105539:	8b 45 20             	mov    0x20(%ebp),%eax
c010553c:	89 04 24             	mov    %eax,(%esp)
c010553f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105542:	ff d0                	call   *%eax
    // first recursively print all preceding (more significant) digits
    if (num >= base) {
        printnum(putch, putdat, result, base, width - 1, padc);
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
c0105544:	83 6d 1c 01          	subl   $0x1,0x1c(%ebp)
c0105548:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c010554c:	7f e4                	jg     c0105532 <printnum+0xca>
            putch(padc, putdat);
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
c010554e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105551:	0f b6 80 60 75 10 c0 	movzbl -0x3fef8aa0(%eax),%eax
c0105558:	0f be c0             	movsbl %al,%eax
c010555b:	8b 55 0c             	mov    0xc(%ebp),%edx
c010555e:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105562:	89 04 24             	mov    %eax,(%esp)
c0105565:	8b 45 08             	mov    0x8(%ebp),%eax
c0105568:	ff d0                	call   *%eax
}
c010556a:	c9                   	leave  
c010556b:	c3                   	ret    

c010556c <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c010556c:	55                   	push   %ebp
c010556d:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c010556f:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0105573:	7e 14                	jle    c0105589 <getuint+0x1d>
        return va_arg(*ap, unsigned long long);
c0105575:	8b 45 08             	mov    0x8(%ebp),%eax
c0105578:	8b 00                	mov    (%eax),%eax
c010557a:	8d 48 08             	lea    0x8(%eax),%ecx
c010557d:	8b 55 08             	mov    0x8(%ebp),%edx
c0105580:	89 0a                	mov    %ecx,(%edx)
c0105582:	8b 50 04             	mov    0x4(%eax),%edx
c0105585:	8b 00                	mov    (%eax),%eax
c0105587:	eb 30                	jmp    c01055b9 <getuint+0x4d>
    }
    else if (lflag) {
c0105589:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010558d:	74 16                	je     c01055a5 <getuint+0x39>
        return va_arg(*ap, unsigned long);
c010558f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105592:	8b 00                	mov    (%eax),%eax
c0105594:	8d 48 04             	lea    0x4(%eax),%ecx
c0105597:	8b 55 08             	mov    0x8(%ebp),%edx
c010559a:	89 0a                	mov    %ecx,(%edx)
c010559c:	8b 00                	mov    (%eax),%eax
c010559e:	ba 00 00 00 00       	mov    $0x0,%edx
c01055a3:	eb 14                	jmp    c01055b9 <getuint+0x4d>
    }
    else {
        return va_arg(*ap, unsigned int);
c01055a5:	8b 45 08             	mov    0x8(%ebp),%eax
c01055a8:	8b 00                	mov    (%eax),%eax
c01055aa:	8d 48 04             	lea    0x4(%eax),%ecx
c01055ad:	8b 55 08             	mov    0x8(%ebp),%edx
c01055b0:	89 0a                	mov    %ecx,(%edx)
c01055b2:	8b 00                	mov    (%eax),%eax
c01055b4:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
c01055b9:	5d                   	pop    %ebp
c01055ba:	c3                   	ret    

c01055bb <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c01055bb:	55                   	push   %ebp
c01055bc:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c01055be:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c01055c2:	7e 14                	jle    c01055d8 <getint+0x1d>
        return va_arg(*ap, long long);
c01055c4:	8b 45 08             	mov    0x8(%ebp),%eax
c01055c7:	8b 00                	mov    (%eax),%eax
c01055c9:	8d 48 08             	lea    0x8(%eax),%ecx
c01055cc:	8b 55 08             	mov    0x8(%ebp),%edx
c01055cf:	89 0a                	mov    %ecx,(%edx)
c01055d1:	8b 50 04             	mov    0x4(%eax),%edx
c01055d4:	8b 00                	mov    (%eax),%eax
c01055d6:	eb 30                	jmp    c0105608 <getint+0x4d>
    }
    else if (lflag) {
c01055d8:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c01055dc:	74 16                	je     c01055f4 <getint+0x39>
        return va_arg(*ap, long);
c01055de:	8b 45 08             	mov    0x8(%ebp),%eax
c01055e1:	8b 00                	mov    (%eax),%eax
c01055e3:	8d 48 04             	lea    0x4(%eax),%ecx
c01055e6:	8b 55 08             	mov    0x8(%ebp),%edx
c01055e9:	89 0a                	mov    %ecx,(%edx)
c01055eb:	8b 00                	mov    (%eax),%eax
c01055ed:	89 c2                	mov    %eax,%edx
c01055ef:	c1 fa 1f             	sar    $0x1f,%edx
c01055f2:	eb 14                	jmp    c0105608 <getint+0x4d>
    }
    else {
        return va_arg(*ap, int);
c01055f4:	8b 45 08             	mov    0x8(%ebp),%eax
c01055f7:	8b 00                	mov    (%eax),%eax
c01055f9:	8d 48 04             	lea    0x4(%eax),%ecx
c01055fc:	8b 55 08             	mov    0x8(%ebp),%edx
c01055ff:	89 0a                	mov    %ecx,(%edx)
c0105601:	8b 00                	mov    (%eax),%eax
c0105603:	89 c2                	mov    %eax,%edx
c0105605:	c1 fa 1f             	sar    $0x1f,%edx
    }
}
c0105608:	5d                   	pop    %ebp
c0105609:	c3                   	ret    

c010560a <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c010560a:	55                   	push   %ebp
c010560b:	89 e5                	mov    %esp,%ebp
c010560d:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
c0105610:	8d 45 14             	lea    0x14(%ebp),%eax
c0105613:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
c0105616:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105619:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010561d:	8b 45 10             	mov    0x10(%ebp),%eax
c0105620:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105624:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105627:	89 44 24 04          	mov    %eax,0x4(%esp)
c010562b:	8b 45 08             	mov    0x8(%ebp),%eax
c010562e:	89 04 24             	mov    %eax,(%esp)
c0105631:	e8 02 00 00 00       	call   c0105638 <vprintfmt>
    va_end(ap);
}
c0105636:	c9                   	leave  
c0105637:	c3                   	ret    

c0105638 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c0105638:	55                   	push   %ebp
c0105639:	89 e5                	mov    %esp,%ebp
c010563b:	56                   	push   %esi
c010563c:	53                   	push   %ebx
c010563d:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0105640:	eb 17                	jmp    c0105659 <vprintfmt+0x21>
            if (ch == '\0') {
c0105642:	85 db                	test   %ebx,%ebx
c0105644:	0f 84 e4 03 00 00    	je     c0105a2e <vprintfmt+0x3f6>
                return;
            }
            putch(ch, putdat);
c010564a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010564d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105651:	89 1c 24             	mov    %ebx,(%esp)
c0105654:	8b 45 08             	mov    0x8(%ebp),%eax
c0105657:	ff d0                	call   *%eax
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0105659:	8b 45 10             	mov    0x10(%ebp),%eax
c010565c:	0f b6 00             	movzbl (%eax),%eax
c010565f:	0f b6 d8             	movzbl %al,%ebx
c0105662:	83 fb 25             	cmp    $0x25,%ebx
c0105665:	0f 95 c0             	setne  %al
c0105668:	83 45 10 01          	addl   $0x1,0x10(%ebp)
c010566c:	84 c0                	test   %al,%al
c010566e:	75 d2                	jne    c0105642 <vprintfmt+0xa>
            }
            putch(ch, putdat);
        }

        // Process a %-escape sequence
        char padc = ' ';
c0105670:	c6 45 f7 20          	movb   $0x20,-0x9(%ebp)
        width = precision = -1;
c0105674:	c7 45 e8 ff ff ff ff 	movl   $0xffffffff,-0x18(%ebp)
c010567b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010567e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        lflag = altflag = 0;
c0105681:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0105688:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010568b:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010568e:	eb 04                	jmp    c0105694 <vprintfmt+0x5c>
            goto process_precision;

        case '.':
            if (width < 0)
                width = 0;
            goto reswitch;
c0105690:	90                   	nop
c0105691:	eb 01                	jmp    c0105694 <vprintfmt+0x5c>
            goto reswitch;

        process_precision:
            if (width < 0)
                width = precision, precision = -1;
            goto reswitch;
c0105693:	90                   	nop
        char padc = ' ';
        width = precision = -1;
        lflag = altflag = 0;

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
c0105694:	8b 45 10             	mov    0x10(%ebp),%eax
c0105697:	0f b6 00             	movzbl (%eax),%eax
c010569a:	0f b6 d8             	movzbl %al,%ebx
c010569d:	89 d8                	mov    %ebx,%eax
c010569f:	83 45 10 01          	addl   $0x1,0x10(%ebp)
c01056a3:	83 e8 23             	sub    $0x23,%eax
c01056a6:	83 f8 55             	cmp    $0x55,%eax
c01056a9:	0f 87 4f 03 00 00    	ja     c01059fe <vprintfmt+0x3c6>
c01056af:	8b 04 85 84 75 10 c0 	mov    -0x3fef8a7c(,%eax,4),%eax
c01056b6:	ff e0                	jmp    *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
c01056b8:	c6 45 f7 2d          	movb   $0x2d,-0x9(%ebp)
            goto reswitch;
c01056bc:	eb d6                	jmp    c0105694 <vprintfmt+0x5c>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
c01056be:	c6 45 f7 30          	movb   $0x30,-0x9(%ebp)
            goto reswitch;
c01056c2:	eb d0                	jmp    c0105694 <vprintfmt+0x5c>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c01056c4:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
                precision = precision * 10 + ch - '0';
c01056cb:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01056ce:	89 d0                	mov    %edx,%eax
c01056d0:	c1 e0 02             	shl    $0x2,%eax
c01056d3:	01 d0                	add    %edx,%eax
c01056d5:	01 c0                	add    %eax,%eax
c01056d7:	01 d8                	add    %ebx,%eax
c01056d9:	83 e8 30             	sub    $0x30,%eax
c01056dc:	89 45 e8             	mov    %eax,-0x18(%ebp)
                ch = *fmt;
c01056df:	8b 45 10             	mov    0x10(%ebp),%eax
c01056e2:	0f b6 00             	movzbl (%eax),%eax
c01056e5:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
c01056e8:	83 fb 2f             	cmp    $0x2f,%ebx
c01056eb:	7e 39                	jle    c0105726 <vprintfmt+0xee>
c01056ed:	83 fb 39             	cmp    $0x39,%ebx
c01056f0:	7f 37                	jg     c0105729 <vprintfmt+0xf1>
            padc = '0';
            goto reswitch;

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c01056f2:	83 45 10 01          	addl   $0x1,0x10(%ebp)
                precision = precision * 10 + ch - '0';
                ch = *fmt;
                if (ch < '0' || ch > '9') {
                    break;
                }
            }
c01056f6:	eb d3                	jmp    c01056cb <vprintfmt+0x93>
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
c01056f8:	8b 45 14             	mov    0x14(%ebp),%eax
c01056fb:	8d 50 04             	lea    0x4(%eax),%edx
c01056fe:	89 55 14             	mov    %edx,0x14(%ebp)
c0105701:	8b 00                	mov    (%eax),%eax
c0105703:	89 45 e8             	mov    %eax,-0x18(%ebp)
            goto process_precision;
c0105706:	eb 22                	jmp    c010572a <vprintfmt+0xf2>

        case '.':
            if (width < 0)
c0105708:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010570c:	79 82                	jns    c0105690 <vprintfmt+0x58>
                width = 0;
c010570e:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
            goto reswitch;
c0105715:	e9 7a ff ff ff       	jmp    c0105694 <vprintfmt+0x5c>

        case '#':
            altflag = 1;
c010571a:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
            goto reswitch;
c0105721:	e9 6e ff ff ff       	jmp    c0105694 <vprintfmt+0x5c>
                ch = *fmt;
                if (ch < '0' || ch > '9') {
                    break;
                }
            }
            goto process_precision;
c0105726:	90                   	nop
c0105727:	eb 01                	jmp    c010572a <vprintfmt+0xf2>
c0105729:	90                   	nop
        case '#':
            altflag = 1;
            goto reswitch;

        process_precision:
            if (width < 0)
c010572a:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010572e:	0f 89 5f ff ff ff    	jns    c0105693 <vprintfmt+0x5b>
                width = precision, precision = -1;
c0105734:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105737:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c010573a:	c7 45 e8 ff ff ff ff 	movl   $0xffffffff,-0x18(%ebp)
            goto reswitch;
c0105741:	e9 4e ff ff ff       	jmp    c0105694 <vprintfmt+0x5c>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
c0105746:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
            goto reswitch;
c010574a:	e9 45 ff ff ff       	jmp    c0105694 <vprintfmt+0x5c>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
c010574f:	8b 45 14             	mov    0x14(%ebp),%eax
c0105752:	8d 50 04             	lea    0x4(%eax),%edx
c0105755:	89 55 14             	mov    %edx,0x14(%ebp)
c0105758:	8b 00                	mov    (%eax),%eax
c010575a:	8b 55 0c             	mov    0xc(%ebp),%edx
c010575d:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105761:	89 04 24             	mov    %eax,(%esp)
c0105764:	8b 45 08             	mov    0x8(%ebp),%eax
c0105767:	ff d0                	call   *%eax
            break;
c0105769:	e9 ba 02 00 00       	jmp    c0105a28 <vprintfmt+0x3f0>

        // error message
        case 'e':
            err = va_arg(ap, int);
c010576e:	8b 45 14             	mov    0x14(%ebp),%eax
c0105771:	8d 50 04             	lea    0x4(%eax),%edx
c0105774:	89 55 14             	mov    %edx,0x14(%ebp)
c0105777:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
c0105779:	85 db                	test   %ebx,%ebx
c010577b:	79 02                	jns    c010577f <vprintfmt+0x147>
                err = -err;
c010577d:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c010577f:	83 fb 06             	cmp    $0x6,%ebx
c0105782:	7f 0d                	jg     c0105791 <vprintfmt+0x159>
c0105784:	89 d8                	mov    %ebx,%eax
c0105786:	8b 34 85 44 75 10 c0 	mov    -0x3fef8abc(,%eax,4),%esi
c010578d:	85 f6                	test   %esi,%esi
c010578f:	75 24                	jne    c01057b5 <vprintfmt+0x17d>
                printfmt(putch, putdat, "error %d", err);
c0105791:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105795:	c7 44 24 08 71 75 10 	movl   $0xc0107571,0x8(%esp)
c010579c:	c0 
c010579d:	8b 45 0c             	mov    0xc(%ebp),%eax
c01057a0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01057a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01057a7:	89 04 24             	mov    %eax,(%esp)
c01057aa:	e8 5b fe ff ff       	call   c010560a <printfmt>
        case 'e':
            err = va_arg(ap, int);
            if (err < 0) {
                err = -err;
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c01057af:	90                   	nop
                printfmt(putch, putdat, "error %d", err);
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
c01057b0:	e9 73 02 00 00       	jmp    c0105a28 <vprintfmt+0x3f0>
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
                printfmt(putch, putdat, "error %d", err);
            }
            else {
                printfmt(putch, putdat, "%s", p);
c01057b5:	89 74 24 0c          	mov    %esi,0xc(%esp)
c01057b9:	c7 44 24 08 7a 75 10 	movl   $0xc010757a,0x8(%esp)
c01057c0:	c0 
c01057c1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01057c4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01057c8:	8b 45 08             	mov    0x8(%ebp),%eax
c01057cb:	89 04 24             	mov    %eax,(%esp)
c01057ce:	e8 37 fe ff ff       	call   c010560a <printfmt>
            }
            break;
c01057d3:	e9 50 02 00 00       	jmp    c0105a28 <vprintfmt+0x3f0>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
c01057d8:	8b 45 14             	mov    0x14(%ebp),%eax
c01057db:	8d 50 04             	lea    0x4(%eax),%edx
c01057de:	89 55 14             	mov    %edx,0x14(%ebp)
c01057e1:	8b 30                	mov    (%eax),%esi
c01057e3:	85 f6                	test   %esi,%esi
c01057e5:	75 05                	jne    c01057ec <vprintfmt+0x1b4>
                p = "(null)";
c01057e7:	be 7d 75 10 c0       	mov    $0xc010757d,%esi
            }
            if (width > 0 && padc != '-') {
c01057ec:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01057f0:	7e 7c                	jle    c010586e <vprintfmt+0x236>
c01057f2:	80 7d f7 2d          	cmpb   $0x2d,-0x9(%ebp)
c01057f6:	74 79                	je     c0105871 <vprintfmt+0x239>
                for (width -= strnlen(p, precision); width > 0; width --) {
c01057f8:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
c01057fb:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01057fe:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105802:	89 34 24             	mov    %esi,(%esp)
c0105805:	e8 25 03 00 00       	call   c0105b2f <strnlen>
c010580a:	89 da                	mov    %ebx,%edx
c010580c:	29 c2                	sub    %eax,%edx
c010580e:	89 d0                	mov    %edx,%eax
c0105810:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105813:	eb 17                	jmp    c010582c <vprintfmt+0x1f4>
                    putch(padc, putdat);
c0105815:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0105819:	8b 55 0c             	mov    0xc(%ebp),%edx
c010581c:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105820:	89 04 24             	mov    %eax,(%esp)
c0105823:	8b 45 08             	mov    0x8(%ebp),%eax
c0105826:	ff d0                	call   *%eax
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
                p = "(null)";
            }
            if (width > 0 && padc != '-') {
                for (width -= strnlen(p, precision); width > 0; width --) {
c0105828:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
c010582c:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0105830:	7f e3                	jg     c0105815 <vprintfmt+0x1dd>
                    putch(padc, putdat);
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c0105832:	eb 3e                	jmp    c0105872 <vprintfmt+0x23a>
                if (altflag && (ch < ' ' || ch > '~')) {
c0105834:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105838:	74 1f                	je     c0105859 <vprintfmt+0x221>
c010583a:	83 fb 1f             	cmp    $0x1f,%ebx
c010583d:	7e 05                	jle    c0105844 <vprintfmt+0x20c>
c010583f:	83 fb 7e             	cmp    $0x7e,%ebx
c0105842:	7e 15                	jle    c0105859 <vprintfmt+0x221>
                    putch('?', putdat);
c0105844:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105847:	89 44 24 04          	mov    %eax,0x4(%esp)
c010584b:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
c0105852:	8b 45 08             	mov    0x8(%ebp),%eax
c0105855:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
                    putch(padc, putdat);
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
                if (altflag && (ch < ' ' || ch > '~')) {
c0105857:	eb 0f                	jmp    c0105868 <vprintfmt+0x230>
                    putch('?', putdat);
                }
                else {
                    putch(ch, putdat);
c0105859:	8b 45 0c             	mov    0xc(%ebp),%eax
c010585c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105860:	89 1c 24             	mov    %ebx,(%esp)
c0105863:	8b 45 08             	mov    0x8(%ebp),%eax
c0105866:	ff d0                	call   *%eax
            if (width > 0 && padc != '-') {
                for (width -= strnlen(p, precision); width > 0; width --) {
                    putch(padc, putdat);
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c0105868:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
c010586c:	eb 04                	jmp    c0105872 <vprintfmt+0x23a>
c010586e:	90                   	nop
c010586f:	eb 01                	jmp    c0105872 <vprintfmt+0x23a>
c0105871:	90                   	nop
c0105872:	0f b6 06             	movzbl (%esi),%eax
c0105875:	0f be d8             	movsbl %al,%ebx
c0105878:	85 db                	test   %ebx,%ebx
c010587a:	0f 95 c0             	setne  %al
c010587d:	83 c6 01             	add    $0x1,%esi
c0105880:	84 c0                	test   %al,%al
c0105882:	74 29                	je     c01058ad <vprintfmt+0x275>
c0105884:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105888:	78 aa                	js     c0105834 <vprintfmt+0x1fc>
c010588a:	83 6d e8 01          	subl   $0x1,-0x18(%ebp)
c010588e:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105892:	79 a0                	jns    c0105834 <vprintfmt+0x1fc>
                }
                else {
                    putch(ch, putdat);
                }
            }
            for (; width > 0; width --) {
c0105894:	eb 17                	jmp    c01058ad <vprintfmt+0x275>
                putch(' ', putdat);
c0105896:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105899:	89 44 24 04          	mov    %eax,0x4(%esp)
c010589d:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c01058a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01058a7:	ff d0                	call   *%eax
                }
                else {
                    putch(ch, putdat);
                }
            }
            for (; width > 0; width --) {
c01058a9:	83 6d e4 01          	subl   $0x1,-0x1c(%ebp)
c01058ad:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01058b1:	7f e3                	jg     c0105896 <vprintfmt+0x25e>
                putch(' ', putdat);
            }
            break;
c01058b3:	e9 70 01 00 00       	jmp    c0105a28 <vprintfmt+0x3f0>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
c01058b8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01058bb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058bf:	8d 45 14             	lea    0x14(%ebp),%eax
c01058c2:	89 04 24             	mov    %eax,(%esp)
c01058c5:	e8 f1 fc ff ff       	call   c01055bb <getint>
c01058ca:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01058cd:	89 55 dc             	mov    %edx,-0x24(%ebp)
            if ((long long)num < 0) {
c01058d0:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01058d3:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01058d6:	85 d2                	test   %edx,%edx
c01058d8:	79 26                	jns    c0105900 <vprintfmt+0x2c8>
                putch('-', putdat);
c01058da:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058dd:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058e1:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
c01058e8:	8b 45 08             	mov    0x8(%ebp),%eax
c01058eb:	ff d0                	call   *%eax
                num = -(long long)num;
c01058ed:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01058f0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01058f3:	f7 d8                	neg    %eax
c01058f5:	83 d2 00             	adc    $0x0,%edx
c01058f8:	f7 da                	neg    %edx
c01058fa:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01058fd:	89 55 dc             	mov    %edx,-0x24(%ebp)
            }
            base = 10;
c0105900:	c7 45 e0 0a 00 00 00 	movl   $0xa,-0x20(%ebp)
            goto number;
c0105907:	e9 a9 00 00 00       	jmp    c01059b5 <vprintfmt+0x37d>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
c010590c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010590f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105913:	8d 45 14             	lea    0x14(%ebp),%eax
c0105916:	89 04 24             	mov    %eax,(%esp)
c0105919:	e8 4e fc ff ff       	call   c010556c <getuint>
c010591e:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0105921:	89 55 dc             	mov    %edx,-0x24(%ebp)
            base = 10;
c0105924:	c7 45 e0 0a 00 00 00 	movl   $0xa,-0x20(%ebp)
            goto number;
c010592b:	e9 85 00 00 00       	jmp    c01059b5 <vprintfmt+0x37d>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
c0105930:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105933:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105937:	8d 45 14             	lea    0x14(%ebp),%eax
c010593a:	89 04 24             	mov    %eax,(%esp)
c010593d:	e8 2a fc ff ff       	call   c010556c <getuint>
c0105942:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0105945:	89 55 dc             	mov    %edx,-0x24(%ebp)
            base = 8;
c0105948:	c7 45 e0 08 00 00 00 	movl   $0x8,-0x20(%ebp)
            goto number;
c010594f:	eb 64                	jmp    c01059b5 <vprintfmt+0x37d>

        // pointer
        case 'p':
            putch('0', putdat);
c0105951:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105954:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105958:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
c010595f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105962:	ff d0                	call   *%eax
            putch('x', putdat);
c0105964:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105967:	89 44 24 04          	mov    %eax,0x4(%esp)
c010596b:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
c0105972:	8b 45 08             	mov    0x8(%ebp),%eax
c0105975:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c0105977:	8b 45 14             	mov    0x14(%ebp),%eax
c010597a:	8d 50 04             	lea    0x4(%eax),%edx
c010597d:	89 55 14             	mov    %edx,0x14(%ebp)
c0105980:	8b 00                	mov    (%eax),%eax
c0105982:	ba 00 00 00 00       	mov    $0x0,%edx
c0105987:	89 45 d8             	mov    %eax,-0x28(%ebp)
c010598a:	89 55 dc             	mov    %edx,-0x24(%ebp)
            base = 16;
c010598d:	c7 45 e0 10 00 00 00 	movl   $0x10,-0x20(%ebp)
            goto number;
c0105994:	eb 1f                	jmp    c01059b5 <vprintfmt+0x37d>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
c0105996:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105999:	89 44 24 04          	mov    %eax,0x4(%esp)
c010599d:	8d 45 14             	lea    0x14(%ebp),%eax
c01059a0:	89 04 24             	mov    %eax,(%esp)
c01059a3:	e8 c4 fb ff ff       	call   c010556c <getuint>
c01059a8:	89 45 d8             	mov    %eax,-0x28(%ebp)
c01059ab:	89 55 dc             	mov    %edx,-0x24(%ebp)
            base = 16;
c01059ae:	c7 45 e0 10 00 00 00 	movl   $0x10,-0x20(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
c01059b5:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c01059b9:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01059bc:	89 54 24 18          	mov    %edx,0x18(%esp)
c01059c0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01059c3:	89 54 24 14          	mov    %edx,0x14(%esp)
c01059c7:	89 44 24 10          	mov    %eax,0x10(%esp)
c01059cb:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01059ce:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01059d1:	89 44 24 08          	mov    %eax,0x8(%esp)
c01059d5:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01059d9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059dc:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059e0:	8b 45 08             	mov    0x8(%ebp),%eax
c01059e3:	89 04 24             	mov    %eax,(%esp)
c01059e6:	e8 7d fa ff ff       	call   c0105468 <printnum>
            break;
c01059eb:	eb 3b                	jmp    c0105a28 <vprintfmt+0x3f0>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
c01059ed:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059f0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059f4:	89 1c 24             	mov    %ebx,(%esp)
c01059f7:	8b 45 08             	mov    0x8(%ebp),%eax
c01059fa:	ff d0                	call   *%eax
            break;
c01059fc:	eb 2a                	jmp    c0105a28 <vprintfmt+0x3f0>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
c01059fe:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a01:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a05:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
c0105a0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a0f:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
c0105a11:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c0105a15:	eb 04                	jmp    c0105a1b <vprintfmt+0x3e3>
c0105a17:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c0105a1b:	8b 45 10             	mov    0x10(%ebp),%eax
c0105a1e:	83 e8 01             	sub    $0x1,%eax
c0105a21:	0f b6 00             	movzbl (%eax),%eax
c0105a24:	3c 25                	cmp    $0x25,%al
c0105a26:	75 ef                	jne    c0105a17 <vprintfmt+0x3df>
                /* do nothing */;
            break;
        }
    }
c0105a28:	90                   	nop
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0105a29:	e9 2b fc ff ff       	jmp    c0105659 <vprintfmt+0x21>
            for (fmt --; fmt[-1] != '%'; fmt --)
                /* do nothing */;
            break;
        }
    }
}
c0105a2e:	83 c4 40             	add    $0x40,%esp
c0105a31:	5b                   	pop    %ebx
c0105a32:	5e                   	pop    %esi
c0105a33:	5d                   	pop    %ebp
c0105a34:	c3                   	ret    

c0105a35 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c0105a35:	55                   	push   %ebp
c0105a36:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
c0105a38:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a3b:	8b 40 08             	mov    0x8(%eax),%eax
c0105a3e:	8d 50 01             	lea    0x1(%eax),%edx
c0105a41:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a44:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
c0105a47:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a4a:	8b 10                	mov    (%eax),%edx
c0105a4c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a4f:	8b 40 04             	mov    0x4(%eax),%eax
c0105a52:	39 c2                	cmp    %eax,%edx
c0105a54:	73 12                	jae    c0105a68 <sprintputch+0x33>
        *b->buf ++ = ch;
c0105a56:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a59:	8b 00                	mov    (%eax),%eax
c0105a5b:	8b 55 08             	mov    0x8(%ebp),%edx
c0105a5e:	88 10                	mov    %dl,(%eax)
c0105a60:	8d 50 01             	lea    0x1(%eax),%edx
c0105a63:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a66:	89 10                	mov    %edx,(%eax)
    }
}
c0105a68:	5d                   	pop    %ebp
c0105a69:	c3                   	ret    

c0105a6a <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c0105a6a:	55                   	push   %ebp
c0105a6b:	89 e5                	mov    %esp,%ebp
c0105a6d:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c0105a70:	8d 45 14             	lea    0x14(%ebp),%eax
c0105a73:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
c0105a76:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a79:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105a7d:	8b 45 10             	mov    0x10(%ebp),%eax
c0105a80:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105a84:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a87:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a8b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a8e:	89 04 24             	mov    %eax,(%esp)
c0105a91:	e8 08 00 00 00       	call   c0105a9e <vsnprintf>
c0105a96:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0105a99:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105a9c:	c9                   	leave  
c0105a9d:	c3                   	ret    

c0105a9e <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c0105a9e:	55                   	push   %ebp
c0105a9f:	89 e5                	mov    %esp,%ebp
c0105aa1:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
c0105aa4:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105aa7:	83 e8 01             	sub    $0x1,%eax
c0105aaa:	03 45 08             	add    0x8(%ebp),%eax
c0105aad:	8b 55 08             	mov    0x8(%ebp),%edx
c0105ab0:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0105ab3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105ab6:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
c0105abd:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0105ac1:	74 0a                	je     c0105acd <vsnprintf+0x2f>
c0105ac3:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105ac6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105ac9:	39 c2                	cmp    %eax,%edx
c0105acb:	76 07                	jbe    c0105ad4 <vsnprintf+0x36>
        return -E_INVAL;
c0105acd:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c0105ad2:	eb 2b                	jmp    c0105aff <vsnprintf+0x61>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
c0105ad4:	b8 35 5a 10 c0       	mov    $0xc0105a35,%eax
c0105ad9:	8b 55 14             	mov    0x14(%ebp),%edx
c0105adc:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0105ae0:	8b 55 10             	mov    0x10(%ebp),%edx
c0105ae3:	89 54 24 08          	mov    %edx,0x8(%esp)
c0105ae7:	8d 55 ec             	lea    -0x14(%ebp),%edx
c0105aea:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105aee:	89 04 24             	mov    %eax,(%esp)
c0105af1:	e8 42 fb ff ff       	call   c0105638 <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
c0105af6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105af9:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
c0105afc:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105aff:	c9                   	leave  
c0105b00:	c3                   	ret    
c0105b01:	00 00                	add    %al,(%eax)
	...

c0105b04 <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c0105b04:	55                   	push   %ebp
c0105b05:	89 e5                	mov    %esp,%ebp
c0105b07:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105b0a:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
c0105b11:	eb 04                	jmp    c0105b17 <strlen+0x13>
        cnt ++;
c0105b13:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
    size_t cnt = 0;
    while (*s ++ != '\0') {
c0105b17:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b1a:	0f b6 00             	movzbl (%eax),%eax
c0105b1d:	84 c0                	test   %al,%al
c0105b1f:	0f 95 c0             	setne  %al
c0105b22:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105b26:	84 c0                	test   %al,%al
c0105b28:	75 e9                	jne    c0105b13 <strlen+0xf>
        cnt ++;
    }
    return cnt;
c0105b2a:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105b2d:	c9                   	leave  
c0105b2e:	c3                   	ret    

c0105b2f <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c0105b2f:	55                   	push   %ebp
c0105b30:	89 e5                	mov    %esp,%ebp
c0105b32:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105b35:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c0105b3c:	eb 04                	jmp    c0105b42 <strnlen+0x13>
        cnt ++;
c0105b3e:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
    size_t cnt = 0;
    while (cnt < len && *s ++ != '\0') {
c0105b42:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105b45:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105b48:	73 13                	jae    c0105b5d <strnlen+0x2e>
c0105b4a:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b4d:	0f b6 00             	movzbl (%eax),%eax
c0105b50:	84 c0                	test   %al,%al
c0105b52:	0f 95 c0             	setne  %al
c0105b55:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105b59:	84 c0                	test   %al,%al
c0105b5b:	75 e1                	jne    c0105b3e <strnlen+0xf>
        cnt ++;
    }
    return cnt;
c0105b5d:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105b60:	c9                   	leave  
c0105b61:	c3                   	ret    

c0105b62 <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c0105b62:	55                   	push   %ebp
c0105b63:	89 e5                	mov    %esp,%ebp
c0105b65:	57                   	push   %edi
c0105b66:	56                   	push   %esi
c0105b67:	83 ec 20             	sub    $0x20,%esp
c0105b6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b6d:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105b70:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b73:	89 45 e4             	mov    %eax,-0x1c(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
c0105b76:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105b79:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105b7c:	89 d1                	mov    %edx,%ecx
c0105b7e:	89 c2                	mov    %eax,%edx
c0105b80:	89 ce                	mov    %ecx,%esi
c0105b82:	89 d7                	mov    %edx,%edi
c0105b84:	ac                   	lods   %ds:(%esi),%al
c0105b85:	aa                   	stos   %al,%es:(%edi)
c0105b86:	84 c0                	test   %al,%al
c0105b88:	75 fa                	jne    c0105b84 <strcpy+0x22>
c0105b8a:	89 fa                	mov    %edi,%edx
c0105b8c:	89 f1                	mov    %esi,%ecx
c0105b8e:	89 4d f4             	mov    %ecx,-0xc(%ebp)
c0105b91:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0105b94:	89 45 ec             	mov    %eax,-0x14(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
c0105b97:	8b 45 e8             	mov    -0x18(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c0105b9a:	83 c4 20             	add    $0x20,%esp
c0105b9d:	5e                   	pop    %esi
c0105b9e:	5f                   	pop    %edi
c0105b9f:	5d                   	pop    %ebp
c0105ba0:	c3                   	ret    

c0105ba1 <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0105ba1:	55                   	push   %ebp
c0105ba2:	89 e5                	mov    %esp,%ebp
c0105ba4:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
c0105ba7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105baa:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
c0105bad:	eb 21                	jmp    c0105bd0 <strncpy+0x2f>
        if ((*p = *src) != '\0') {
c0105baf:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105bb2:	0f b6 10             	movzbl (%eax),%edx
c0105bb5:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105bb8:	88 10                	mov    %dl,(%eax)
c0105bba:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105bbd:	0f b6 00             	movzbl (%eax),%eax
c0105bc0:	84 c0                	test   %al,%al
c0105bc2:	74 04                	je     c0105bc8 <strncpy+0x27>
            src ++;
c0105bc4:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
        }
        p ++, len --;
c0105bc8:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
c0105bcc:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
    char *p = dst;
    while (len > 0) {
c0105bd0:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105bd4:	75 d9                	jne    c0105baf <strncpy+0xe>
        if ((*p = *src) != '\0') {
            src ++;
        }
        p ++, len --;
    }
    return dst;
c0105bd6:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105bd9:	c9                   	leave  
c0105bda:	c3                   	ret    

c0105bdb <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c0105bdb:	55                   	push   %ebp
c0105bdc:	89 e5                	mov    %esp,%ebp
c0105bde:	57                   	push   %edi
c0105bdf:	56                   	push   %esi
c0105be0:	83 ec 20             	sub    $0x20,%esp
c0105be3:	8b 45 08             	mov    0x8(%ebp),%eax
c0105be6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105be9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105bec:	89 45 e4             	mov    %eax,-0x1c(%ebp)
#ifndef __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_STRCMP
static inline int
__strcmp(const char *s1, const char *s2) {
    int d0, d1, ret;
    asm volatile (
c0105bef:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105bf2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105bf5:	89 d1                	mov    %edx,%ecx
c0105bf7:	89 c2                	mov    %eax,%edx
c0105bf9:	89 ce                	mov    %ecx,%esi
c0105bfb:	89 d7                	mov    %edx,%edi
c0105bfd:	ac                   	lods   %ds:(%esi),%al
c0105bfe:	ae                   	scas   %es:(%edi),%al
c0105bff:	75 08                	jne    c0105c09 <strcmp+0x2e>
c0105c01:	84 c0                	test   %al,%al
c0105c03:	75 f8                	jne    c0105bfd <strcmp+0x22>
c0105c05:	31 c0                	xor    %eax,%eax
c0105c07:	eb 04                	jmp    c0105c0d <strcmp+0x32>
c0105c09:	19 c0                	sbb    %eax,%eax
c0105c0b:	0c 01                	or     $0x1,%al
c0105c0d:	89 fa                	mov    %edi,%edx
c0105c0f:	89 f1                	mov    %esi,%ecx
c0105c11:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105c14:	89 4d f4             	mov    %ecx,-0xc(%ebp)
c0105c17:	89 55 f0             	mov    %edx,-0x10(%ebp)
        "orb $1, %%al;"
        "3:"
        : "=a" (ret), "=&S" (d0), "=&D" (d1)
        : "1" (s1), "2" (s2)
        : "memory");
    return ret;
c0105c1a:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c0105c1d:	83 c4 20             	add    $0x20,%esp
c0105c20:	5e                   	pop    %esi
c0105c21:	5f                   	pop    %edi
c0105c22:	5d                   	pop    %ebp
c0105c23:	c3                   	ret    

c0105c24 <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c0105c24:	55                   	push   %ebp
c0105c25:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105c27:	eb 0c                	jmp    c0105c35 <strncmp+0x11>
        n --, s1 ++, s2 ++;
c0105c29:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c0105c2d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105c31:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105c35:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105c39:	74 1a                	je     c0105c55 <strncmp+0x31>
c0105c3b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c3e:	0f b6 00             	movzbl (%eax),%eax
c0105c41:	84 c0                	test   %al,%al
c0105c43:	74 10                	je     c0105c55 <strncmp+0x31>
c0105c45:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c48:	0f b6 10             	movzbl (%eax),%edx
c0105c4b:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c4e:	0f b6 00             	movzbl (%eax),%eax
c0105c51:	38 c2                	cmp    %al,%dl
c0105c53:	74 d4                	je     c0105c29 <strncmp+0x5>
        n --, s1 ++, s2 ++;
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c0105c55:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105c59:	74 1a                	je     c0105c75 <strncmp+0x51>
c0105c5b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c5e:	0f b6 00             	movzbl (%eax),%eax
c0105c61:	0f b6 d0             	movzbl %al,%edx
c0105c64:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c67:	0f b6 00             	movzbl (%eax),%eax
c0105c6a:	0f b6 c0             	movzbl %al,%eax
c0105c6d:	89 d1                	mov    %edx,%ecx
c0105c6f:	29 c1                	sub    %eax,%ecx
c0105c71:	89 c8                	mov    %ecx,%eax
c0105c73:	eb 05                	jmp    c0105c7a <strncmp+0x56>
c0105c75:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105c7a:	5d                   	pop    %ebp
c0105c7b:	c3                   	ret    

c0105c7c <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0105c7c:	55                   	push   %ebp
c0105c7d:	89 e5                	mov    %esp,%ebp
c0105c7f:	83 ec 04             	sub    $0x4,%esp
c0105c82:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c85:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105c88:	eb 14                	jmp    c0105c9e <strchr+0x22>
        if (*s == c) {
c0105c8a:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c8d:	0f b6 00             	movzbl (%eax),%eax
c0105c90:	3a 45 fc             	cmp    -0x4(%ebp),%al
c0105c93:	75 05                	jne    c0105c9a <strchr+0x1e>
            return (char *)s;
c0105c95:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c98:	eb 13                	jmp    c0105cad <strchr+0x31>
        }
        s ++;
c0105c9a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
    while (*s != '\0') {
c0105c9e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ca1:	0f b6 00             	movzbl (%eax),%eax
c0105ca4:	84 c0                	test   %al,%al
c0105ca6:	75 e2                	jne    c0105c8a <strchr+0xe>
        if (*s == c) {
            return (char *)s;
        }
        s ++;
    }
    return NULL;
c0105ca8:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105cad:	c9                   	leave  
c0105cae:	c3                   	ret    

c0105caf <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0105caf:	55                   	push   %ebp
c0105cb0:	89 e5                	mov    %esp,%ebp
c0105cb2:	83 ec 04             	sub    $0x4,%esp
c0105cb5:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105cb8:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105cbb:	eb 0f                	jmp    c0105ccc <strfind+0x1d>
        if (*s == c) {
c0105cbd:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cc0:	0f b6 00             	movzbl (%eax),%eax
c0105cc3:	3a 45 fc             	cmp    -0x4(%ebp),%al
c0105cc6:	74 10                	je     c0105cd8 <strfind+0x29>
            break;
        }
        s ++;
c0105cc8:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
    while (*s != '\0') {
c0105ccc:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ccf:	0f b6 00             	movzbl (%eax),%eax
c0105cd2:	84 c0                	test   %al,%al
c0105cd4:	75 e7                	jne    c0105cbd <strfind+0xe>
c0105cd6:	eb 01                	jmp    c0105cd9 <strfind+0x2a>
        if (*s == c) {
            break;
c0105cd8:	90                   	nop
        }
        s ++;
    }
    return (char *)s;
c0105cd9:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105cdc:	c9                   	leave  
c0105cdd:	c3                   	ret    

c0105cde <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0105cde:	55                   	push   %ebp
c0105cdf:	89 e5                	mov    %esp,%ebp
c0105ce1:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
c0105ce4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    long val = 0;
c0105ceb:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0105cf2:	eb 04                	jmp    c0105cf8 <strtol+0x1a>
        s ++;
c0105cf4:	83 45 08 01          	addl   $0x1,0x8(%ebp)
strtol(const char *s, char **endptr, int base) {
    int neg = 0;
    long val = 0;

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0105cf8:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cfb:	0f b6 00             	movzbl (%eax),%eax
c0105cfe:	3c 20                	cmp    $0x20,%al
c0105d00:	74 f2                	je     c0105cf4 <strtol+0x16>
c0105d02:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d05:	0f b6 00             	movzbl (%eax),%eax
c0105d08:	3c 09                	cmp    $0x9,%al
c0105d0a:	74 e8                	je     c0105cf4 <strtol+0x16>
        s ++;
    }

    // plus/minus sign
    if (*s == '+') {
c0105d0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d0f:	0f b6 00             	movzbl (%eax),%eax
c0105d12:	3c 2b                	cmp    $0x2b,%al
c0105d14:	75 06                	jne    c0105d1c <strtol+0x3e>
        s ++;
c0105d16:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105d1a:	eb 15                	jmp    c0105d31 <strtol+0x53>
    }
    else if (*s == '-') {
c0105d1c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d1f:	0f b6 00             	movzbl (%eax),%eax
c0105d22:	3c 2d                	cmp    $0x2d,%al
c0105d24:	75 0b                	jne    c0105d31 <strtol+0x53>
        s ++, neg = 1;
c0105d26:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105d2a:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0105d31:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105d35:	74 06                	je     c0105d3d <strtol+0x5f>
c0105d37:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0105d3b:	75 24                	jne    c0105d61 <strtol+0x83>
c0105d3d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d40:	0f b6 00             	movzbl (%eax),%eax
c0105d43:	3c 30                	cmp    $0x30,%al
c0105d45:	75 1a                	jne    c0105d61 <strtol+0x83>
c0105d47:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d4a:	83 c0 01             	add    $0x1,%eax
c0105d4d:	0f b6 00             	movzbl (%eax),%eax
c0105d50:	3c 78                	cmp    $0x78,%al
c0105d52:	75 0d                	jne    c0105d61 <strtol+0x83>
        s += 2, base = 16;
c0105d54:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0105d58:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
    else if (*s == '-') {
        s ++, neg = 1;
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0105d5f:	eb 2a                	jmp    c0105d8b <strtol+0xad>
        s += 2, base = 16;
    }
    else if (base == 0 && s[0] == '0') {
c0105d61:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105d65:	75 17                	jne    c0105d7e <strtol+0xa0>
c0105d67:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d6a:	0f b6 00             	movzbl (%eax),%eax
c0105d6d:	3c 30                	cmp    $0x30,%al
c0105d6f:	75 0d                	jne    c0105d7e <strtol+0xa0>
        s ++, base = 8;
c0105d71:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105d75:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
        s += 2, base = 16;
    }
    else if (base == 0 && s[0] == '0') {
c0105d7c:	eb 0d                	jmp    c0105d8b <strtol+0xad>
        s ++, base = 8;
    }
    else if (base == 0) {
c0105d7e:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105d82:	75 07                	jne    c0105d8b <strtol+0xad>
        base = 10;
c0105d84:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0105d8b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d8e:	0f b6 00             	movzbl (%eax),%eax
c0105d91:	3c 2f                	cmp    $0x2f,%al
c0105d93:	7e 1b                	jle    c0105db0 <strtol+0xd2>
c0105d95:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d98:	0f b6 00             	movzbl (%eax),%eax
c0105d9b:	3c 39                	cmp    $0x39,%al
c0105d9d:	7f 11                	jg     c0105db0 <strtol+0xd2>
            dig = *s - '0';
c0105d9f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105da2:	0f b6 00             	movzbl (%eax),%eax
c0105da5:	0f be c0             	movsbl %al,%eax
c0105da8:	83 e8 30             	sub    $0x30,%eax
c0105dab:	89 45 fc             	mov    %eax,-0x4(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0105dae:	eb 48                	jmp    c0105df8 <strtol+0x11a>
            dig = *s - '0';
        }
        else if (*s >= 'a' && *s <= 'z') {
c0105db0:	8b 45 08             	mov    0x8(%ebp),%eax
c0105db3:	0f b6 00             	movzbl (%eax),%eax
c0105db6:	3c 60                	cmp    $0x60,%al
c0105db8:	7e 1b                	jle    c0105dd5 <strtol+0xf7>
c0105dba:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dbd:	0f b6 00             	movzbl (%eax),%eax
c0105dc0:	3c 7a                	cmp    $0x7a,%al
c0105dc2:	7f 11                	jg     c0105dd5 <strtol+0xf7>
            dig = *s - 'a' + 10;
c0105dc4:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dc7:	0f b6 00             	movzbl (%eax),%eax
c0105dca:	0f be c0             	movsbl %al,%eax
c0105dcd:	83 e8 57             	sub    $0x57,%eax
c0105dd0:	89 45 fc             	mov    %eax,-0x4(%ebp)
        int dig;

        if (*s >= '0' && *s <= '9') {
            dig = *s - '0';
        }
        else if (*s >= 'a' && *s <= 'z') {
c0105dd3:	eb 23                	jmp    c0105df8 <strtol+0x11a>
            dig = *s - 'a' + 10;
        }
        else if (*s >= 'A' && *s <= 'Z') {
c0105dd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dd8:	0f b6 00             	movzbl (%eax),%eax
c0105ddb:	3c 40                	cmp    $0x40,%al
c0105ddd:	7e 38                	jle    c0105e17 <strtol+0x139>
c0105ddf:	8b 45 08             	mov    0x8(%ebp),%eax
c0105de2:	0f b6 00             	movzbl (%eax),%eax
c0105de5:	3c 5a                	cmp    $0x5a,%al
c0105de7:	7f 2e                	jg     c0105e17 <strtol+0x139>
            dig = *s - 'A' + 10;
c0105de9:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dec:	0f b6 00             	movzbl (%eax),%eax
c0105def:	0f be c0             	movsbl %al,%eax
c0105df2:	83 e8 37             	sub    $0x37,%eax
c0105df5:	89 45 fc             	mov    %eax,-0x4(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
c0105df8:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105dfb:	3b 45 10             	cmp    0x10(%ebp),%eax
c0105dfe:	7d 16                	jge    c0105e16 <strtol+0x138>
            break;
        }
        s ++, val = (val * base) + dig;
c0105e00:	83 45 08 01          	addl   $0x1,0x8(%ebp)
c0105e04:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105e07:	0f af 45 10          	imul   0x10(%ebp),%eax
c0105e0b:	03 45 fc             	add    -0x4(%ebp),%eax
c0105e0e:	89 45 f8             	mov    %eax,-0x8(%ebp)
        // we don't properly detect overflow!
    }
c0105e11:	e9 75 ff ff ff       	jmp    c0105d8b <strtol+0xad>
        }
        else {
            break;
        }
        if (dig >= base) {
            break;
c0105e16:	90                   	nop
        }
        s ++, val = (val * base) + dig;
        // we don't properly detect overflow!
    }

    if (endptr) {
c0105e17:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0105e1b:	74 08                	je     c0105e25 <strtol+0x147>
        *endptr = (char *) s;
c0105e1d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105e20:	8b 55 08             	mov    0x8(%ebp),%edx
c0105e23:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
c0105e25:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105e29:	74 07                	je     c0105e32 <strtol+0x154>
c0105e2b:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105e2e:	f7 d8                	neg    %eax
c0105e30:	eb 03                	jmp    c0105e35 <strtol+0x157>
c0105e32:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0105e35:	c9                   	leave  
c0105e36:	c3                   	ret    

c0105e37 <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0105e37:	55                   	push   %ebp
c0105e38:	89 e5                	mov    %esp,%ebp
c0105e3a:	57                   	push   %edi
c0105e3b:	83 ec 24             	sub    $0x24,%esp
c0105e3e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105e41:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
c0105e44:	0f be 45 d8          	movsbl -0x28(%ebp),%eax
c0105e48:	8b 55 08             	mov    0x8(%ebp),%edx
c0105e4b:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0105e4e:	88 45 ef             	mov    %al,-0x11(%ebp)
c0105e51:	8b 45 10             	mov    0x10(%ebp),%eax
c0105e54:	89 45 e8             	mov    %eax,-0x18(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
c0105e57:	8b 4d e8             	mov    -0x18(%ebp),%ecx
c0105e5a:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
c0105e5e:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105e61:	89 d7                	mov    %edx,%edi
c0105e63:	f3 aa                	rep stos %al,%es:(%edi)
c0105e65:	89 fa                	mov    %edi,%edx
c0105e67:	89 4d f8             	mov    %ecx,-0x8(%ebp)
c0105e6a:	89 55 f4             	mov    %edx,-0xc(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
c0105e6d:	8b 45 f0             	mov    -0x10(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0105e70:	83 c4 24             	add    $0x24,%esp
c0105e73:	5f                   	pop    %edi
c0105e74:	5d                   	pop    %ebp
c0105e75:	c3                   	ret    

c0105e76 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0105e76:	55                   	push   %ebp
c0105e77:	89 e5                	mov    %esp,%ebp
c0105e79:	57                   	push   %edi
c0105e7a:	56                   	push   %esi
c0105e7b:	83 ec 30             	sub    $0x30,%esp
c0105e7e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e81:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0105e84:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105e87:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0105e8a:	8b 45 10             	mov    0x10(%ebp),%eax
c0105e8d:	89 45 c8             	mov    %eax,-0x38(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
c0105e90:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105e93:	3b 45 cc             	cmp    -0x34(%ebp),%eax
c0105e96:	73 42                	jae    c0105eda <memmove+0x64>
c0105e98:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105e9b:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105e9e:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0105ea1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105ea4:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0105ea7:	89 45 e0             	mov    %eax,-0x20(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0105eaa:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105ead:	89 c1                	mov    %eax,%ecx
c0105eaf:	c1 e9 02             	shr    $0x2,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
    int d0, d1, d2;
    asm volatile (
c0105eb2:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105eb5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105eb8:	89 d7                	mov    %edx,%edi
c0105eba:	89 c6                	mov    %eax,%esi
c0105ebc:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0105ebe:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c0105ec1:	83 e1 03             	and    $0x3,%ecx
c0105ec4:	74 02                	je     c0105ec8 <memmove+0x52>
c0105ec6:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105ec8:	89 f0                	mov    %esi,%eax
c0105eca:	89 fa                	mov    %edi,%edx
c0105ecc:	89 4d f4             	mov    %ecx,-0xc(%ebp)
c0105ecf:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0105ed2:	89 45 ec             	mov    %eax,-0x14(%ebp)
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
        : "memory");
    return dst;
c0105ed5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ed8:	eb 2f                	jmp    c0105f09 <memmove+0x93>
    asm volatile (
        "std;"
        "rep; movsb;"
        "cld;"
        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0105eda:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0105edd:	83 e8 01             	sub    $0x1,%eax
c0105ee0:	89 c2                	mov    %eax,%edx
c0105ee2:	03 55 cc             	add    -0x34(%ebp),%edx
c0105ee5:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0105ee8:	83 e8 01             	sub    $0x1,%eax
c0105eeb:	03 45 d0             	add    -0x30(%ebp),%eax
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
        return __memcpy(dst, src, n);
    }
    int d0, d1, d2;
    asm volatile (
c0105eee:	8b 4d c8             	mov    -0x38(%ebp),%ecx
c0105ef1:	89 d6                	mov    %edx,%esi
c0105ef3:	89 c7                	mov    %eax,%edi
c0105ef5:	fd                   	std    
c0105ef6:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105ef8:	fc                   	cld    
c0105ef9:	89 f8                	mov    %edi,%eax
c0105efb:	89 f2                	mov    %esi,%edx
c0105efd:	89 4d dc             	mov    %ecx,-0x24(%ebp)
c0105f00:	89 55 d8             	mov    %edx,-0x28(%ebp)
c0105f03:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        "rep; movsb;"
        "cld;"
        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
        : "memory");
    return dst;
c0105f06:	8b 45 d0             	mov    -0x30(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c0105f09:	83 c4 30             	add    $0x30,%esp
c0105f0c:	5e                   	pop    %esi
c0105f0d:	5f                   	pop    %edi
c0105f0e:	5d                   	pop    %ebp
c0105f0f:	c3                   	ret    

c0105f10 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0105f10:	55                   	push   %ebp
c0105f11:	89 e5                	mov    %esp,%ebp
c0105f13:	57                   	push   %edi
c0105f14:	56                   	push   %esi
c0105f15:	83 ec 20             	sub    $0x20,%esp
c0105f18:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f1b:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105f1e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105f21:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105f24:	8b 45 10             	mov    0x10(%ebp),%eax
c0105f27:	89 45 e0             	mov    %eax,-0x20(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0105f2a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105f2d:	89 c1                	mov    %eax,%ecx
c0105f2f:	c1 e9 02             	shr    $0x2,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
    int d0, d1, d2;
    asm volatile (
c0105f32:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105f35:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105f38:	89 d7                	mov    %edx,%edi
c0105f3a:	89 c6                	mov    %eax,%esi
c0105f3c:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0105f3e:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c0105f41:	83 e1 03             	and    $0x3,%ecx
c0105f44:	74 02                	je     c0105f48 <memcpy+0x38>
c0105f46:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105f48:	89 f0                	mov    %esi,%eax
c0105f4a:	89 fa                	mov    %edi,%edx
c0105f4c:	89 4d f4             	mov    %ecx,-0xc(%ebp)
c0105f4f:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0105f52:	89 45 ec             	mov    %eax,-0x14(%ebp)
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
        : "memory");
    return dst;
c0105f55:	8b 45 e8             	mov    -0x18(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c0105f58:	83 c4 20             	add    $0x20,%esp
c0105f5b:	5e                   	pop    %esi
c0105f5c:	5f                   	pop    %edi
c0105f5d:	5d                   	pop    %ebp
c0105f5e:	c3                   	ret    

c0105f5f <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0105f5f:	55                   	push   %ebp
c0105f60:	89 e5                	mov    %esp,%ebp
c0105f62:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
c0105f65:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f68:	89 45 f8             	mov    %eax,-0x8(%ebp)
    const char *s2 = (const char *)v2;
c0105f6b:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105f6e:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (n -- > 0) {
c0105f71:	eb 32                	jmp    c0105fa5 <memcmp+0x46>
        if (*s1 != *s2) {
c0105f73:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105f76:	0f b6 10             	movzbl (%eax),%edx
c0105f79:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105f7c:	0f b6 00             	movzbl (%eax),%eax
c0105f7f:	38 c2                	cmp    %al,%dl
c0105f81:	74 1a                	je     c0105f9d <memcmp+0x3e>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
c0105f83:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105f86:	0f b6 00             	movzbl (%eax),%eax
c0105f89:	0f b6 d0             	movzbl %al,%edx
c0105f8c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105f8f:	0f b6 00             	movzbl (%eax),%eax
c0105f92:	0f b6 c0             	movzbl %al,%eax
c0105f95:	89 d1                	mov    %edx,%ecx
c0105f97:	29 c1                	sub    %eax,%ecx
c0105f99:	89 c8                	mov    %ecx,%eax
c0105f9b:	eb 1c                	jmp    c0105fb9 <memcmp+0x5a>
        }
        s1 ++, s2 ++;
c0105f9d:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
c0105fa1:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
    const char *s1 = (const char *)v1;
    const char *s2 = (const char *)v2;
    while (n -- > 0) {
c0105fa5:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105fa9:	0f 95 c0             	setne  %al
c0105fac:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
c0105fb0:	84 c0                	test   %al,%al
c0105fb2:	75 bf                	jne    c0105f73 <memcmp+0x14>
        if (*s1 != *s2) {
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
        }
        s1 ++, s2 ++;
    }
    return 0;
c0105fb4:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105fb9:	c9                   	leave  
c0105fba:	c3                   	ret    
